1. Go to this page and download the library: Download leocavalcante/siler 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/ */
leocavalcante / siler example snippets
use Siler\Functional as λ; // Just to be cool, don't use non-ASCII identifiers ;)
use Siler\Route;
Route\get('/', λ\puts('Hello, World!'));
use Siler\Route;
use Siler\Http\Response;
Route\get('/', fn() => Response\json(['message' => 'Hello, World!']));
use Siler\Http\Response;
use Siler\Route;
use Siler\Swoole;
$handler = function () {
Route\get('/', fn() => Response\json('Hello, World!'));
};
$port = 8000;
echo "Listening on port $port\n";
Swoole\http($handler, $port)->start();