PHP code example of uuu9 / cors

1. Go to this page and download the library: Download uuu9/cors library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

uuu9 / cors example snippets


$app->register(Uuu9\Cors\Middleware\CorsServiceProvider::class);

$app->routeMiddleware([
    ......
    'cors' => Uuu9\Cors\Middleware\Cors::class,
]);


$app->middleware([
    'cors'=>Uuu9\Cors\Middleware\Cors::class,

]);

$app->routeMiddleware([
    ......
    'cors' => Uuu9\Cors\Middleware\Cors::class,
]);