euskadi31/cors-service-provider

A CORS Service Provider for Silex 2.0

v1.0.2 2016-06-15 09:40 UTC

This package is not auto-updated.

Last update: 2024-04-13 15:06:37 UTC


README

Build Status SensioLabsInsight

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.