summaryrefslogtreecommitdiff
path: root/src/Router.php
diff options
context:
space:
mode:
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");