diff --git a/HttpServer/Route/Node.php b/HttpServer/Route/Node.php index 3145afcb..92191709 100644 --- a/HttpServer/Route/Node.php +++ b/HttpServer/Route/Node.php @@ -438,6 +438,7 @@ class Node extends Application if (empty($this->callback)) { return JSON::to(404, $node->_error ?? 'Page not found.'); } + var_dump($this->callback); $requestParams = func_get_args(); if (func_num_args() > 0) { return call_user_func($this->callback, ...$requestParams); diff --git a/HttpServer/Route/Router.php b/HttpServer/Route/Router.php index 36615ba3..b7667000 100644 --- a/HttpServer/Route/Router.php +++ b/HttpServer/Route/Router.php @@ -481,13 +481,12 @@ class Router extends Application implements RouterInterface return send(self::NOT_FOUND, 404); } send($node->dispatch(), 200); -// if ($node->hasAfter()) { -// $node->afterDispatch(\request()); -// } + if ($node->hasAfter()) { + $node->afterDispatch(\request()); + } } catch (ExitException $exception) { send($exception->getMessage(), $exception->getCode()); } catch (\Throwable $exception) { - var_dump($exception->getMessage()); send($this->exception($exception), 200); } }