Open acorn371 opened 1 year ago
Hi, I have a router like the following, using a Pipeline for an authorization middleware.
router.get( '/user/<user_id>', Pipeline() .addMiddleware(authorize(authorization)) .addHandler(_getCurrentUserHandler));
I see I could use something like:
router.get('/user/<user_id>', (Request request, String user_id) { ??? });
But I don't know how to use my pipeline with the second handler form, the one using the param user_id because method addHandler get and return an Handler of the form FutureOr<Response> Function(Request request); Any idea ? Many thanks
FutureOr<Response> Function(Request request);
@acorn371 , would something like this help (my example):
playersRouter.get( "/<id>", Pipeline().addHandler((request) => getPlayerController.call(request, request.params["id"]!)), );
Hi, I have a router like the following, using a Pipeline for an authorization middleware.
I see I could use something like:
But I don't know how to use my pipeline with the second handler form, the one using the param user_id because method addHandler get and return an Handler of the form
FutureOr<Response> Function(Request request);
Any idea ? Many thanks