2017 © Pedro Peláez
 

library lumen-cors

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

image

palanik/lumen-cors

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

  • Saturday, June 24, 2017
  • by palanik
  • Repository
  • 5 Watchers
  • 85 Stars
  • 63,258 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 23 Forks
  • 7 Open issues
  • 4 Versions
  • 11 % Grown

The README.md

Lumen-CORS

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

Latest Stable Version License, (*2)

Installation

After you install lumen as per lumen docs, install lumen-cors from lumen folder., (*3)

Install with Composer

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

Manual Installation

Copy the file LumenCors.php into app/Http/Middleware directory., (*5)

Usage

Global CORS

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

CORS for Routes

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

$app->routeMiddleware([
    'cors' => 'palanik\lumen\Middleware\LumenCors',
]);

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

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

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

License

MIT, (*10)

The Versions

24/06 2017

dev-master

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

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

  Sources   Download

MIT

by Avatar palanik

laravel cors lumen cross-origin preflight corslumen lumencors

24/06 2017

v0.0.3

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

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

  Sources   Download

MIT

by Avatar palanik

laravel cors lumen cross-origin preflight corslumen lumencors

07/06 2016

v0.0.2

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

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

  Sources   Download

MIT

by Avatar palanik

laravel cors lumen cross-origin preflight corslumen lumencors

20/04 2015

v0.0.1

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

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

  Sources   Download

MIT

by Avatar palanik

laravel cors lumen cross-origin preflight corslumen lumencors