PHP code example of papimod / cors

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

    

papimod / cors example snippets




use Papi\PapiBuilder;
use Papimod\Dotenv\DotEnvModule;
use Papimod\Common\CommonModule;
use Papimod\HttpError\HttpErrorModule;
use Papimod\Cors\CorsModule;
use function DI\create;

$builder = new PapiBuilder();

$builder
    ->setModule(
        DotEnvModule::class, # Prerequisite
        CommonModule::class, # Prerequisite of HttpErrorModule
        HttpErrorModule::class, # Prerequisite
        CorsModule::class
    )
    ->build()
    ->run();