summaryrefslogtreecommitdiff
path: root/src/Router.php
diff options
context:
space:
mode:
authorDaniel Weipert <git@mail.dweipert.de>2025-08-12 18:02:39 +0200
committerDaniel Weipert <git@mail.dweipert.de>2025-08-12 18:02:45 +0200
commit5ab89da146929734a39c7a55619b8bf8298ab832 (patch)
tree48746c1320b274f3c00f7c45aa7e512743e1ef75 /src/Router.php
parent1fc29c6029cfa8c7dce5535ff9cfb2daaa6427e0 (diff)
implement phpunit integration tests
Diffstat (limited to 'src/Router.php')
-rw-r--r--src/Router.php7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/Router.php b/src/Router.php
index 319d5e2..e0b09ad 100644
--- a/src/Router.php
+++ b/src/Router.php
@@ -24,6 +24,10 @@ class Router
$this->addRoutes();
}
+ /**
+ * match the current url against the routes.
+ * also add preflight CORS headers on OPTIONS requests.
+ */
public function run(): Response
{
$request = Request::createFromGlobals();
@@ -55,6 +59,9 @@ class Router
}
}
+ /**
+ * add routes from the routes file
+ */
private function addRoutes(): void
{
$routes = include_once(__DIR__ . "/routes.php");