2017 © Pedro Peláez
 

library lumenpsr7cors

image

jkirkby91/lumenpsr7cors

  • Thursday, December 7, 2017
  • by jkirkby91
  • Repository
  • 0 Watchers
  • 0 Stars
  • 95 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 5 Versions
  • 0 % Grown

The README.md

Lumen-CORS

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

Latest Stable Version, (*2)

Installation

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

Install with Composer

Run composer require "Jkirkby91-2/LumenPSR7Cors" to install lumen-cors., (*4)

Usage

Global CORS

If you want CORS enabled for every HTTP request to your application, simply list the middleware class Jkirkby91\LumenPSR7Cors\Http\Middleware\Cors 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 lumen-cors middleware a short-hand key in your bootstrap/app.php file., (*6)

$app->routeMiddleware([
    'cors' => 'Jkirkby91\LumenPSR7Cors\Http\Middleware\Cors',
]);

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

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

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

License

MIT, (*9)

The Versions

07/12 2017
03/05 2017

dev-master

9999999-dev

  Sources   Download

The Requires

 

The Development Requires

03/05 2017
03/05 2017
20/03 2017

v1.0.0-alpha

1.0.0.0-alpha

  Sources   Download

The Requires

 

The Development Requires