havenshen / slim-cors
Slim Framework 3 CORS middleware
v1.0.0
2017-03-24 08:59 UTC
Requires (Dev)
- phpunit/phpunit: ^6.0
- slim/slim: ^3.8
This package is auto-updated.
Last update: 2024-12-22 14:37:40 UTC
README
This repository contains a Slim Framework CORS middleware.
Install
Via Composer
$ composer require havenshen/slim-cors
Requires Slim 3.0.0 or newer.
Usage
In most cases you want to register HavenShen\Slim\Cors.
Register
$app = new \Slim\App([ 'settings' => [ 'dispayErrorDetails' => true, ] ]); $container = $app->getContainer(); $container['cors'] = function ($c) { return new \HavenShen\Slim\Cors\Guard; }; $app->add($container->get('cors'));
Testing
$ phpunit
Development progress
continues to update...
License
The MIT License (MIT). Please see License File for more information.