PHP code example of qlimix / http-cors-middleware

1. Go to this page and download the library: Download qlimix/http-cors-middleware 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/ */

    

qlimix / http-cors-middleware example snippets




use Neomerx\Cors\Analyzer;
use Neomerx\Cors\Strategies\Settings;
use Neomerx\Cors\Factory\Factory;
use Qlimix\HttpMiddleware\CorsMiddleware;

$analyzer = new Analyzer(new Settings(), new Factory());
$responseFactory = new ResponseFactoryImplementation();

$corsMiddleware = new CorsMiddleware($analyzer, $responseFactory);

// add to middleware request handler