diff --git a/http-helper/Route/Router.php b/http-helper/Route/Router.php index e507394c..9fc520af 100644 --- a/http-helper/Route/Router.php +++ b/http-helper/Route/Router.php @@ -8,6 +8,7 @@ use Closure; use Exception; use Http\Abstracts\HttpService; use Http\Controller; +use Http\Handler\Abstracts\HandlerManager; use Http\IInterface\MiddlewareInterface; use Http\IInterface\RouterInterface; use JetBrains\PhpStorm\Pure; @@ -103,6 +104,14 @@ class Router extends HttpService implements RouterInterface if ($handler instanceof Closure) { $handler = Closure::bind($handler, di(Controller::class)); } + + $path = $this->addPrefix() . '/' . ltrim($path, '/'); + + + + HandlerManager::add($path, $method, $handler); + + return null; return $this->tree($path, $handler, $method); }