Skip to content

Commit

Permalink
Merge pull request #8 from UnderDevCrew/feature/allow-cors
Browse files Browse the repository at this point in the history
Allow cors requests
  • Loading branch information
ToxEn committed May 22, 2016
2 parents 649b63f + bc96eac commit ddb5514
Show file tree
Hide file tree
Showing 4 changed files with 78 additions and 3 deletions.
1 change: 1 addition & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@ public function registerBundles()
new AppBundle\AppBundle(),
new Doctrine\Bundle\MigrationsBundle\DoctrineMigrationsBundle(),
new UnderDevCrew\Bundle\PlacesApiBundle\UnderDevCrewPlacesApiBundle(),
new Nelmio\CorsBundle\NelmioCorsBundle(),
];

if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
Expand Down
16 changes: 16 additions & 0 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,3 +68,19 @@ swiftmailer:
username: "%mailer_user%"
password: "%mailer_password%"
spool: { type: memory }

nelmio_cors:
defaults:
allow_credentials: false
allow_origin: []
allow_headers: []
allow_methods: []
expose_headers: []
max_age: 0
hosts: []
origin_regex: false
paths:
'^/':
allow_origin: ['*']
allow_methods: ['GET']
max_age: 3600
3 changes: 2 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
"phpunit/phpunit": "^5.3",
"nekland/base-api": "dev-master",
"nekland/places-api": "dev-master",
"guzzlehttp/guzzle": "^5.3"
"guzzlehttp/guzzle": "^5.3",
"nelmio/cors-bundle": "^1.4"
},
"require-dev": {
"sensio/generator-bundle": "^3.0",
Expand Down
61 changes: 59 additions & 2 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ddb5514

Please sign in to comment.