Skip to content

Commit

Permalink
Added CORS support
Browse files Browse the repository at this point in the history
Conflicts:
	app/AppKernel.php
	app/config/config.yml
	composer.json
	composer.lock
  • Loading branch information
guilhermednt committed Nov 5, 2015
1 parent 9910837 commit 3807423
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 5 deletions.
2 changes: 2 additions & 0 deletions app/AppKernel.php
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,8 @@ public function registerBundles()

new OAuth2\ServerBundle\OAuth2ServerBundle(),
new LoginCidadao\OpenIDBundle\LoginCidadaoOpenIDBundle(),

new Nelmio\CorsBundle\NelmioCorsBundle(),
);

if (in_array($this->getEnvironment(), array('dev', 'test'))) {
Expand Down
13 changes: 13 additions & 0 deletions app/config/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,12 @@ doctrine:
countif: PROCERGS\LoginCidadao\CoreBundle\DQL\CountIf
lowerunaccent: PROCERGS\LoginCidadao\CoreBundle\DQL\LowerUnaccent

datetime_functions:
date: Oro\ORM\Query\AST\Functions\SimpleFunction

numeric_functions:
dayofweek: Oro\ORM\Query\AST\Functions\SimpleFunction

# Swiftmailer Configuration
swiftmailer:
transport: %mailer_transport%
Expand Down Expand Up @@ -380,3 +386,10 @@ scheb_two_factor:
security_tokens:
- Symfony\Component\Security\Core\Authentication\Token\UsernamePasswordToken
- FOS\FacebookBundle\Security\Authentication\Token\FacebookUserToken

nelmio_cors:
paths:
'^/api/':
allow_origin: ['*']
allow_headers: ['*']
allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
4 changes: 3 additions & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,9 @@
"bshaffer/oauth2-server-bundle": "dev-develop",
"phpseclib/phpseclib": "2.0.0",
"gree/jose": "^2.0",
"league/uri": "^4.0"
"league/uri": "^4.0",
"oro/doctrine-extensions": "^1.0",
"nelmio/cors-bundle": "^1.4"
},
"require-dev": {
"sensio/generator-bundle" : "~2.3"
Expand Down
117 changes: 113 additions & 4 deletions composer.lock

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

0 comments on commit 3807423

Please sign in to comment.