Entry point to build an HTTP server.
composer require innmind/http-server
require 'vendor/autoload.php';
use Innmind\HttpServer\Main;
use Innmind\Http\{
ServerRequest,
Response,
ServerRequest\Environment,
};
use Innmind\OperatingSystem\OperatingSystem;
new class extends Main {
protected function preload(OperatingSystem $os, Environment $env): void
{
// optional, use this method to boostrap your app
}
protected function main(ServerRequest $request): Response
{
// handle the request here
}
};