slovocast/app/server/server.php

21 lines
455 B
PHP

<?php
require_once '../vendor/autoload.php';
use Slovocast\Bootstrap;
use React\Http\HttpServer;
use React\Socket\SocketServer;
use Psr\Http\Message\ServerRequestInterface as Request;
$app = Bootstrap::init();
$http = new HttpServer(function (Request $request) use ($app) {
return $app->handle($request);
});
$address = "127.0.0.1:8000";
$socket = new SocketServer($address);
$http->listen($socket);
echo "Server running at $address" . PHP_EOL;