PHP code example of kodus / sapi-host

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

    

kodus / sapi-host example snippets




use Kodus\Http\SapiHost;
use Nyholm\Psr7\Factory\Psr17Factory;

$factory = new Psr17Factory();

$host = new SapiHost(
    $factory,
    $factory,
    $factory,
    $factory,
    $factory
);

$host->dispatch(new YourRequestHandler());