PHP code example of geggleto / csp-middleware

1. Go to this page and download the library: Download geggleto/csp-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/ */

    

geggleto / csp-middleware example snippets


//Examples written to use Slim 3
$cspMiddleware = CSPMiddleware::fromFile('/path/to/source.json');

//App Middleware
$app->add($cspMiddleware);

//Route Middleware
$app->get(''...)->add($cspMiddleware);