Skip to content

Innmind/HttpServer

Repository files navigation

Http Server

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

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages