Http router and dispatcher for development purpose

0.0.3 2023-04-30 17:27 UTC

This package is auto-updated.

Last update: 2024-10-30 01:42:54 UTC


README

Http router and dispatcher for development purpose.

Install

Via composer

$ composer require brenoroosevelt/http

Usage

<?php
declare(strict_types=1);

use BrenoRoosevelt\Http\Http;
use Laminas\Diactoros\Response\HtmlResponse;
use Middlewares\Whoops;

require "../vendor/autoload.php";

$app = new Http();
$app->append(new Whoops());

$app->get('/', function () {
    return new HtmlResponse("<h1>Olá, mundo!</h1>");
});

$app->run();