Skip to content

Commit

Permalink
feat: add app/Http/Kernel.php
Browse files Browse the repository at this point in the history
  • Loading branch information
albertcht committed Aug 8, 2024
1 parent 8bed043 commit a39e55f
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 1 deletion.
47 changes: 47 additions & 0 deletions app/Http/Kernel.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
<?php

declare(strict_types=1);

namespace App\Http;

use SwooleTW\Hyperf\Foundation\Http\Kernel as HttpKernel;

class Kernel extends HttpKernel
{
/**
* The application's global HTTP middleware stack.
*
* These middleware are run during every request to your application.
*
* @var array<int, class-string|string>
*/
protected array $middleware = [
// \SwooleTW\Hyperf\Cookie\Middleware\AddQueuedCookiesToResponse::class,
];

/**
* The application's route middleware groups.
*
* @var array<string, array<int, class-string|string>>
*/
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<string, class-string|string>
*/
protected array $middlewareAliases = [
//
];
}
2 changes: 1 addition & 1 deletion config/server.php
Original file line number Diff line number Diff line change
Expand Up @@ -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'],
],
],
],
Expand Down

0 comments on commit a39e55f

Please sign in to comment.