Skip to content

Adding middleware on $app->addRoute not gonna work #19

Closed
@iqbalfn

Description

@iqbalfn

As the title said, adding middlewares with $app->addRoute($method, $path, $handler, ['middleware'=>[...]]) not gonna work because the script that add the middleware overwritten.

Please inspect this line

public function addRoute($httpMethod, string $route, $handler, array $options = [])
{
    // ...
    return $router->addRoute($httpMethod, $route, $handler, $options = []);
}

It should return $router->addRoute($httpMethod, $route, $handler, $options);.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions