euskadi31 / cors-service-provider
A CORS Service Provider for Silex 2.0
Installs: 18 522
Dependents: 1
Suggesters: 0
Security: 0
Stars: 2
Watchers: 3
Forks: 5
Open Issues: 3
Requires
- silex/silex: ~2.0@dev
Requires (Dev)
- leaphub/phpcs-symfony2-standard: ~2.0.1
- phpunit/phpunit: ^4.7
This package is not auto-updated.
Last update: 2024-10-26 18:17:30 UTC
README
The CorsServiceProvider provides CORS support as middleware for your silex 2.0 application. CORS allows you to make AJAX requests across domains. CORS uses OPTIONS requests to make preflight requests. Because silex doesn't have functionality for serving OPTIONS request by default, this service goes through all of your routes and generates the necessary OPTIONS routes.
Install
Add euskadi31/cors-service-provider
to your composer.json
:
% php composer.phar require euskadi31/cors-service-provider:~1.0
Usage
Configuration
<?php $app = new Silex\Application; $app->register(new \Euskadi31\Silex\Provider\CorsServiceProvider);
License
CorsServiceProvider is licensed under the MIT license.