Skip to content

alexpts/php-next2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

5 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

Next2

phpunit codecov

High performance mico framework

Install

composer require alexpts/next2

Docs

http://alexpts.github.io/php-next2-docs/

Hello World

<?php

use PTS\Next2\Context\ContextInterface;
use PTS\Next2\MicroApp;
use PTS\Psr7\Response\JsonResponse;
use PTS\Psr7\ServerRequest;
use PTS\Psr7\Uri;

require_once './vendor/autoload.php';

$psr7Request = new ServerRequest('GET', new Uri('/'));

$app = new MicroApp;

$app->store->get('/', function(ContextInterface $ctx) {
    $response = new JsonResponse(['message' => 'Hello World!']);
    $ctx->setResponse($response);
});

$psr7Response = $app->handle($psr7Request); // psr-15 runner

About

๐Ÿš€ Micro Framework for applications

Resources

Stars

Watchers

Forks

Releases

No releases published

Languages