router = new HttpFx; $this->router->use('/', fn($resp) => $resp->setPoweredBy('Satori')); } public function getRouter(): IRouter { return $this->router; } public function registerDefaultErrorPages(): void { $this->router->addErrorHandler(401, fn($resp) => $resp->setContent(file_get_contents(SAT_DIR_PUBLIC . '/404.html'))); $this->router->addErrorHandler(403, fn($resp) => $resp->setContent(file_get_contents(SAT_DIR_PUBLIC . '/404.html'))); $this->router->addErrorHandler(404, fn($resp) => $resp->setContent(file_get_contents(SAT_DIR_PUBLIC . '/404.html'))); $this->router->addErrorHandler(500, fn($resp) => $resp->setContent(file_get_contents(SAT_DIR_PUBLIC . '/404.html'))); $this->router->addErrorHandler(503, fn($resp) => $resp->setContent(file_get_contents(SAT_DIR_PUBLIC . '/404.html'))); } public function register(IRouteHandler $handler): void { $this->router->register($handler); } public function dispatch(?HttpRequest $request = null): void { $this->router->dispatch($request); } }