innmind / http-server
Http server
4.1.0
2024-03-10 14:49 UTC
Requires
- php: ~8.2
- innmind/http: ~7.0
- innmind/operating-system: ~4.0|~5.0
Requires (Dev)
- innmind/coding-standard: ~2.0
- vimeo/psalm: ~4.30
README
Entry point to build an HTTP server.
Installation
composer require innmind/http-server
Usage
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 } };