slovocast/app/server/server.php

18 lines
424 B
PHP
Raw Normal View History

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();
$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;