Symfony3 – Rest API

How to create a Symfony Rest API from scratch

Initialize the project

Install dependencies

FosRestBundle

Is the base for our REST API, it will manage client request to answer the right response (Exemple : JSON or XML)

JMSSerializerBundle

This is the bundle that handles the actual serialization of our objects, arrays and values.

NelmioCorsBundle

CORS are some headers that our server will output in order to allow a different domain to call our API.

Register bundles

Configure bundles

Ok now let’s code on the next page

Pages: 1 2 3