Skip to content

Empress is a flexible microframework for creating async web applications in PHP 8.1.

License

Notifications You must be signed in to change notification settings

empress-php/empress

Repository files navigation

Build Latest Stable Version Coverage Status License: MIT

Work in progress ⚡

Empress is a flexible PHP 8.1 microframework for creating async web applications. It's based on amphp/http-server. The name is a portmanteau of Express and Amp as Empress's simplicity was first inspired by Express.js. Later, many useful ideas were incorporated from Spark and Javalin. Ultimately it's also the name of one of the cards from major arcana, part of the tarot deck.

Documentation

Read the Wiki for more information and make sure to check out the Getting Started tutorial.

Taste it

<?php
// app.php

use Empress\Application;
use Empress\Context;
use Empress\Routing\RouteCollector\AnnotatedRouteCollectorTrait;
use Empress\Routing\RouteCollector\Attribute\Group;
use Empress\Routing\RouteCollector\Attribute\Route;

#[Group('/hello')]
class IndexController
{
    use AnnotatedRouteCollectorTrait;

    #[Route('GET', '/')]
    public function index(Context $ctx)
    {
        $ctx->response('<h1>Hello!</h1>');
    }
}

$app = Application::create(9010);
$app->routes(new IndexController());

return $app;

// Run it:
// vendor/bin/empress app.php

About

Empress is a flexible microframework for creating async web applications in PHP 8.1.

Resources

License

Stars

Watchers

Forks

Packages

No packages published