Skip to content

Latest commit

 

History

History
41 lines (32 loc) · 934 Bytes

File metadata and controls

41 lines (32 loc) · 934 Bytes

Http Server

CI Type Coverage

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,
};
use Innmind\OperatingSystem\OperatingSystem;
use Innmind\Immutable\Map;

new class extends Main {
    /**
     * @param Map<string, string> $env
     */
    protected function preload(OperatingSystem $os, Map $env): void
    {
        // optional, use this method to boostrap your app
    }

    protected function main(ServerRequest $request): Response
    {
        // handle the request here
    }
};