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'], ], ], ],