Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add composer suggestions #225

Merged
merged 1 commit into from Oct 15, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -112,6 +112,59 @@ Rest of the command are executed inside `project` folder.
checkout_resolver:
pattern: "%sylius.security.shop_regex%/checkout/"
```

6. (optional) if you have installed `nelmio/NelmioCorsBundle` for Support of Cross-Origin Ajax Request,
1. Add the NelmioCorsBundle to the AppKernel

```php
// app/AppKernel.php

/**
* {@inheritdoc}
*/
public function registerBundles()
{
$bundles = array(
// ...
new Nelmio\CorsBundle\NelmioCorsBundle(),
// ...
);
// ...
}
```

2. Add the configuration to the `config.yml

```yml
# app/config/config.yml

# ...

nelmio_cors:
defaults:
allow_credentials: false
allow_origin: []
allow_headers: []
allow_methods: []
expose_headers: []
max_age: 0
hosts: []
origin_regex: false
forced_allow_origin_value: ~
paths:
'^/shop-api/':
allow_origin: ['*']
allow_headers: ['X-Custom-Auth']
allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
max_age: 3600
'^/':
origin_regex: true
allow_origin: ['^http://localhost:[0-9]+']
allow_headers: ['X-Custom-Auth']
allow_methods: ['POST', 'PUT', 'GET', 'DELETE']
max_age: 3600
hosts: ['^api\.']
```

## Additional features

Expand Down
3 changes: 3 additions & 0 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,5 +30,8 @@
"psr-4": {
"Tests\\Sylius\\ShopApiPlugin\\": "tests/"
}
},
"suggest": {
"nelmio/cors-bundle": "allows you to send Cross-Origin Ajax API Request"
}
}