From a39e55fc1ba957f497149b118b3fe3746a2d11df Mon Sep 17 00:00:00 2001 From: Albert Chen Date: Fri, 9 Aug 2024 00:58:20 +0800 Subject: [PATCH] feat: add app/Http/Kernel.php --- app/Http/Kernel.php | 47 +++++++++++++++++++++++++++++++++++++++++++++ config/server.php | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 app/Http/Kernel.php diff --git a/app/Http/Kernel.php b/app/Http/Kernel.php new file mode 100644 index 0000000..f76c253 --- /dev/null +++ b/app/Http/Kernel.php @@ -0,0 +1,47 @@ + + */ + protected array $middleware = [ + // \SwooleTW\Hyperf\Cookie\Middleware\AddQueuedCookiesToResponse::class, + ]; + + /** + * The application's route middleware groups. + * + * @var array> + */ + protected array $middlewareGroups = [ + 'web' => [ + // + ], + + 'api' => [ + // + ], + ]; + + /** + * The application's middleware aliases. + * + * Aliases may be used instead of class names to conveniently assign middleware to routes and groups. + * + * @var array + */ + protected array $middlewareAliases = [ + // + ]; +} diff --git a/config/server.php b/config/server.php index 56f6afb..6c5bc69 100644 --- a/config/server.php +++ b/config/server.php @@ -23,7 +23,7 @@ 'port' => 9501, 'sock_type' => SWOOLE_SOCK_TCP, 'callbacks' => [ - Event::ON_REQUEST => [Hyperf\HttpServer\Server::class, 'onRequest'], + Event::ON_REQUEST => [App\Http\Kernel::class, 'onRequest'], ], ], ],