Skip to content

Commit 060f043

Browse files
committed
other way to add middleware?
1 parent 5376710 commit 060f043

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

solid/lib/AppInfo/Application.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,14 +58,14 @@ public function register(IRegistrationContext $context): void {
5858
/**
5959
* Middleware
6060
*/
61-
$container->registerService(SolidCorsMiddleware::class, function(IServerContainer $c): SolidCorsMiddleware{
61+
$context->registerService('SolidCorsMiddleware', function($c) {
6262
return new SolidCorsMiddleware(
6363
$c->get(IRequest::class)
6464
);
6565
});
6666

6767
// executed in the order that it is registered
68-
$container->registerMiddleware(SolidCorsMiddleware::class);
68+
$context->registerMiddleware('SolidCorsMiddleware');
6969
}
7070

7171
public function boot(IBootContext $context): void {

0 commit comments

Comments
 (0)