Skip to content
No description, website, or topics provided.
Branch: master
Clone or download
Latest commit 5707f41 Apr 5, 2019
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
README.md update Apr 5, 2019

README.md

Zend Expressive integration for roadrunner

The entrypoint file can look like bellow:


declare(strict_types=1);

ini_set('display_errors', 'stderr');

chdir(dirname(__DIR__));
require 'vendor/autoload.php';

$relay = new Spiral\Goridge\StreamRelay(STDIN, STDOUT);
$psr7 = new Spiral\RoadRunner\PSR7Client(new Spiral\RoadRunner\Worker($relay));

$app = (function () {
    $container = require 'config/container.php';
    $app = $container->get(\Zend\Expressive\Application::class);
    $factory = $container->get(\Zend\Expressive\MiddlewareFactory::class);
    (require 'config/pipeline.php')($app, $factory, $container);
    (require 'config/routes.php')($app, $factory, $container);

    return $app;
})();


while ($req = $psr7->acceptRequest()) {
    try {
        $response = $app->handle($req);
        $psr7->respond($response);
    } catch (\Throwable $e) {
        $psr7->getWorker()->error((string)$e);
    }
}
You can’t perform that action at this time.