From 928584c92acb7ce9f997cabf86590e1cdd9f31a1 Mon Sep 17 00:00:00 2001 From: Johannes Kantz <67144859+JohannesKantz@users.noreply.github.com> Date: Thu, 8 Dec 2022 14:52:20 +0100 Subject: [PATCH] fix: redirect everything to index.php --- Router/Router.php | 1 + index.php | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/Router/Router.php b/Router/Router.php index 936dd4f..c73e630 100644 --- a/Router/Router.php +++ b/Router/Router.php @@ -21,6 +21,7 @@ class Router { $this->uri = is_countable($_SERVER['REQUEST_URI']) && count($_SERVER['REQUEST_URI']) > 1 ? rtrim($_SERVER['REQUEST_URI'], "/") : $_SERVER['REQUEST_URI']; $this->uri = str_replace($pathname, "", $this->uri); + var_dump($this->uri); $this->requestType = $_SERVER['REQUEST_METHOD']; $this->routes = []; $this->middleware = []; diff --git a/index.php b/index.php index 9be39bc..ea5d48d 100644 --- a/index.php +++ b/index.php @@ -13,4 +13,8 @@ $app->get("/", function (array $req, Response $res) { $res->send("Hello World"); }); +$app->get("/user", function (array $req, Response $res) { + $res->send("user"); +}); + $app->start(); \ No newline at end of file