2017 © Pedro Peláez
 

library cors-lumen

Cross-origin resource sharing (CORS) middleware & ServiceProvider for Lumen micro-framework.

image

dragonfire1119/cors-lumen

Cross-origin resource sharing (CORS) middleware & ServiceProvider for Lumen micro-framework.

  • Friday, June 26, 2015
  • by dragonfire1119
  • Repository
  • 2 Watchers
  • 3 Stars
  • 456 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 6 Versions
  • 2 % Grown

The README.md

CORS for Lumen

Latest Stable Version License, (*1)

Cross-origin resource sharing (CORS) Middleware for Lumen micro-framework., (*2)

Install with Composer

Run composer require "dragonfire1119/cors-lumen:dev-master" to install cors-lumen., (*3)

Usage

Add CORS ServiceProvider

If you want to allow OPTIONS method then your going to need to enable the CorsServiceProvider in the bootstrap/app.php file., (*4)

$app->register('Dragonfire1119\Cors\Providers\CorsServiceProvider');

Global CORS

If you want CORS enabled for every HTTP request to your application, simply list the middleware class Dragonfire1119\Cors\Middleware\CorsMiddleware in the $app->middleware() call of your bootstrap/app.php file., (*5)

CORS for Routes

If you would like to enable CORS to specific routes, you should first assign the cors middleware a short-hand key in your bootstrap/app.php file., (*6)

$app->routeMiddleware([
    'cors' => 'Dragonfire1119\Cors\Middleware\CorsMiddleware',
]);

Then, you use the key in the route options array., (*7)

$app->get('/api/test', ['middleware' => 'cors', function() {
    //
}]);

More info. - http://lumen.laravel.com/docs/middleware#registering-middleware, (*8)

Contributing

If you have a change fork it & make a pull request. :), (*9)

License

Released under the MIT, see LICENSE., (*10)

The Versions

26/06 2015

dev-master

9999999-dev https://github.com/dragonfire1119/cors-lumen

Cross-origin resource sharing (CORS) middleware & ServiceProvider for Lumen micro-framework.

  Sources   Download

MIT

The Requires

 

by Avatar dragonfire1119

laravel cors lumen cross-origin preflight corslumen lumencors

30/04 2015

v0.1.0

0.1.0.0 https://github.com/dragonfire1119/cors-lumen

Cross-origin resource sharing (CORS) middleware & ServiceProvider for Lumen micro-framework.

  Sources   Download

MIT

The Requires

 

by Avatar dragonfire1119

laravel cors lumen cross-origin preflight corslumen lumencors

27/04 2015

v0.0.4

0.0.4.0 https://github.com/dragonfire1119/cors-lumen

Cross-origin resource sharing (CORS) middleware & ServiceProvider for Lumen micro-framework.

  Sources   Download

MIT

by Avatar dragonfire1119

laravel cors lumen cross-origin preflight corslumen lumencors

27/04 2015

v0.0.3

0.0.3.0 https://github.com/dragonfire1119/cors-lumen

Cross-origin resource sharing (CORS) middleware & ServiceProvider for Lumen micro-framework.

  Sources   Download

MIT

by Avatar dragonfire1119

laravel cors lumen cross-origin preflight corslumen lumencors

26/04 2015

v0.0.2

0.0.2.0 https://github.com/dragonfire1119/cors-lumen

Cross-origin resource sharing (CORS) middleware & ServiceProvider for Lumen micro-framework.

  Sources   Download

MIT

by Avatar dragonfire1119

laravel cors lumen cross-origin preflight corslumen lumencors

26/04 2015

v0.0.1

0.0.1.0 https://github.com/dragonfire1119/cors-lumen

Cross-origin resource sharing (CORS) middleware & ServiceProvider for Lumen micro-framework.

  Sources   Download

MIT

by Avatar dragonfire1119

laravel cors lumen cross-origin preflight corslumen lumencors