From: Jérôme Benoit Date: Thu, 28 Jun 2018 09:32:06 +0000 (+0200) Subject: Move configuration into the rigth files. X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;ds=inline;h=9b636c8d45d9b7355cee4cf6105f6aeb1d4612fc;p=Project_proches_de_moi-server.git Move configuration into the rigth files. Signed-off-by: Jérôme Benoit --- diff --git a/config/config.yaml b/config/config.yaml deleted file mode 100644 index 1bb645b..0000000 --- a/config/config.yaml +++ /dev/null @@ -1,24 +0,0 @@ -#config/config.yml - -framework: - serializer: - enabled: true - -fos_rest: - routing_loader: - include_format: false - view: - view_response_listener: true - mime_types: - json: ['application/json', 'application/json;version=1.0', 'application/json;version=2.0'] - format_listener: - rules: - - { path: '^/api', priorities: ['json'], fallback_format: 'json' } - body_listener: - enabled: true - versioning: - enabled: true - resolvers: - media_type: # Accept header - enabled: true - regex: '/(v|version)=(?P[0-9\.]+)/' diff --git a/config/packages/fos_rest.yaml b/config/packages/fos_rest.yaml index 0440800..f706289 100644 --- a/config/packages/fos_rest.yaml +++ b/config/packages/fos_rest.yaml @@ -13,3 +13,21 @@ fos_rest: ~ # format_listener: # rules: # - { path: ^/api, prefer_extension: true, fallback_format: json, priorities: [ json, html ] } + + routing_loader: + include_format: false + view: + view_response_listener: true + mime_types: + json: ['application/json', 'application/json;version=1.0', 'application/json;version=2.0'] + format_listener: + rules: + - { path: '^/api', priorities: ['json'], fallback_format: 'json' } + body_listener: + enabled: true + versioning: + enabled: true + resolvers: + media_type: # Accept header + enabled: true + regex: '/(v|version)=(?P[0-9\.]+)/' diff --git a/config/packages/framework.yaml b/config/packages/framework.yaml index f37ff70..02784c0 100644 --- a/config/packages/framework.yaml +++ b/config/packages/framework.yaml @@ -28,4 +28,6 @@ framework: # APCu (not recommended with heavy random-write workloads as memory fragmentation can cause perf issues) #app: cache.adapter.apcu - templating: { engines: ['twig'] } + + serializer: + enabled: true diff --git a/config/routes.yaml b/config/routes.yaml index c3283aa..6538363 100644 --- a/config/routes.yaml +++ b/config/routes.yaml @@ -1,3 +1,6 @@ #index: # path: / # controller: App\Controller\DefaultController::index +person: + type: rest + resource: App\Controller\PersonController diff --git a/config/routing.yaml b/config/routing.yaml deleted file mode 100644 index f7572ad..0000000 --- a/config/routing.yaml +++ /dev/null @@ -1,3 +0,0 @@ -person: - type: rest - resource: App\Controller\PersonController