Skip to content

Commit

Permalink
Add middleware to example
Browse files Browse the repository at this point in the history
  • Loading branch information
andyhorn committed Mar 6, 2024
1 parent f86bad6 commit 2cf6dcf
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion pkgs/shelf_router/example/main.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,11 @@ class Service {
return Response.notFound('Page not found');
});

return router.call;
// Set up your Pipeline with any middleware you want to use and set the
// router as the handler.
return const Pipeline()
.addMiddleware(logRequests())
.addHandler(router.call);
}
}

Expand Down

0 comments on commit 2cf6dcf

Please sign in to comment.