2024-06-20 02:20:42 +00:00
|
|
|
<?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();
|
|
|
|
|
2024-06-21 01:55:37 +00:00
|
|
|
$http = new HttpServer(fn (Request $request) => $app->handle($request));
|
2024-06-20 02:20:42 +00:00
|
|
|
$address = "127.0.0.1:8000";
|
|
|
|
$socket = new SocketServer($address);
|
|
|
|
$http->listen($socket);
|
|
|
|
|
|
|
|
echo "Server running at $address" . PHP_EOL;
|