Skip to content
Update instalacion authored by David Q's avatar David Q
...@@ -22,6 +22,8 @@ En la sección de "require": ...@@ -22,6 +22,8 @@ En la sección de "require":
"lynx/apibundle" : "dev-master" "lynx/apibundle" : "dev-master"
} }
` `
Colocar en el `composer.json` `"sensio/framework-extra-bundle": "^3.0.2"`.
## Paso 2: Descargar el bundle ## Paso 2: Descargar el bundle
...@@ -114,3 +116,64 @@ lynx_api: ...@@ -114,3 +116,64 @@ lynx_api:
``` ```
ROLE_API: ROLE_API ROLE_API: ROLE_API
``` ```
## Paso 7: Agregar en config.yml
```
nelmio_cors:
defaults:
allow_credentials: false
allow_origin: ['*']
allow_headers: ['X-Custom-Auth']
allow_methods: ['POST', 'PUT', 'GET', 'DELETE', 'OPTIONS']
max_age: 3600
hosts: []
origin_regex: false
paths:
'^/api/':
allow_origin: ['*']
allow_credentials: true
allow_headers: ['Authorization', 'X-Requested-With', 'Content-Type', 'Accept', 'Origin', 'X-Custom-Auth', 'apikey']
allow_methods: ['POST', 'PUT', 'GET', 'DELETE', 'OPTIONS']
max_age: 3600
nelmio_api_doc:
name: API Mr Pedidos
#motd:
# template: InmobiliaAPIBundle::Components/motd.html.twig
sandbox:
endpoint: http://127.0.0.1:8000/app_dev.php
body_format:
formats: []
request_format:
formats: []
fos_rest:
disable_csrf_role: IS_AUTHENTICATED_ANONYMOUSLY
param_fetcher_listener: true
body_listener: true
format_listener: true
view:
empty_content: 204
#http://symfony.com/doc/current/bundles/FOSRestBundle/view_response_listener.html
#https://github.com/FriendsOfSymfony/FOSRestBundle/issues/1354
#El error de incompatibilidad de soluciono con estos link
view_response_listener: true
formats:
xml: false
html: false
json : true
templating_formats:
html: true
force_redirects:
html: true
failed_validation: HTTP_BAD_REQUEST
default_engine: twig
format_listener:
rules:
- { path: '^/api', priorities: ['json'], fallback_format: json, prefer_extension: false }
- { path: '^/', stop: true }
routing_loader:
default_format: json
```