Skip to content

This repository contains a Slim Framework CORS middleware.

License

Notifications You must be signed in to change notification settings

HavenShen/Slim-Cors

Repository files navigation

Slim Framework CORS Protection

Scrutinizer Code Quality Build Status Code Coverage Build Status Latest Stable Version Latest Unstable Version Latest Stable Version Total Downloads License

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.

About

This repository contains a Slim Framework CORS middleware.

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages