PHP code example of nickstarlight / spdy

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

    

nickstarlight / spdy example snippets


 declare(strict_types=1);

*/
$app = new Nickstarlight\Spdy\App();

/** Get the default router instance */
$router = $app->getRouter();

/** Declare a route */
$router->get('/', fn () => [ 'message' => 'Hello World' ]);

/** Kickstart the event-loop */
$app->run();
yaml
version: "2.7"

server:
  command: "php yourscript.php"

http:
  address: 0.0.0.0:8080