Bugfix, Document constructor, docker

This commit is contained in:
2022-06-01 12:28:50 +02:00
parent 366dbbd6cf
commit ce3aa574ea
19 changed files with 159 additions and 83 deletions

View File

@@ -16,9 +16,9 @@ class ApiRoute extends AbstractRoute {
$user = $router->getUser();
if (empty($params["endpoint"])) {
header("Content-Type: text/html");
$document = new \Elements\TemplateDocument($user, "swagger.twig");
$document = new \Elements\TemplateDocument($router, "swagger.twig");
return $document->getCode();
} else if(!preg_match("/[a-zA-Z]+(\/[a-zA-Z]+)*/", $params["endpoint"])) {
} else if (!preg_match("/[a-zA-Z]+/", $params["endpoint"])) {
http_response_code(400);
$response = createError("Invalid Method");
} else {