innmind/http-server

Http server

Installs: 11 170

Dependents: 3

Suggesters: 0

Security: 0

Stars: 0

Watchers: 1

Forks: 0

pkg:composer/innmind/http-server

6.0.0 2026-02-08 10:18 UTC

This package is auto-updated.

Last update: 2026-02-08 11:09:17 UTC


README

Build Status 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
    }
};