feat: new frontend

This commit is contained in:
Rekryt
2025-07-02 20:40:13 +03:00
parent bda887db3c
commit 7d7c82514f
111 changed files with 5223 additions and 52 deletions

View File

@@ -10,6 +10,7 @@ use Amp\Http\Server\Response;
use Psr\Log\LoggerInterface;
use Throwable;
use function OpenCCK\dbg;
use function OpenCCK\getEnv;
final class HTTPHandler extends Handler implements HTTPHandlerInterface {

View File

@@ -98,7 +98,9 @@ final class Server implements AppModuleInterface {
// $this->bindContext
//);
$router = new Router($this->httpServer, $this->logger, $this->errorHandler);
$router->addRoute('GET', '/', HTTPHandler::getInstance($this->logger)->getHandler());
$httpHandler = HTTPHandler::getInstance($this->logger)->getHandler();
$router->addRoute('GET', '/', $httpHandler);
$router->addRoute('GET', '/{name:.+}', $httpHandler);
$router->setFallback(new DocumentRoot($this->httpServer, $this->errorHandler, PATH_ROOT . '/public'));
$this->httpServer->start($router, $this->errorHandler);