slovocast/app/server/server.php

18 lines
424 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(fn (Request $request) => $app->handle($request));
$address = "127.0.0.1:8000";
$socket = new SocketServer($address);
$http->listen($socket);
echo "Server running at $address" . PHP_EOL;