-
Notifications
You must be signed in to change notification settings - Fork 651
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add example of define.middleware to init (#2534)
The documentation for `MiddlewareFn` is out of date, because it references a nonexistent `defineMiddleware` function. It's been updated to reference the correct `define.middleware` function. Additionally, I included an example of using this in the init project. I also complicated the usage of `app.get` so that the function actually uses the context. To make it clear to users of fresh 1 that this can be equivalent to a file-based-route, I've included such a route as well. The two new examples in `maini.ts` should make it much more clear to fresh 1 users how the new system can work.
- Loading branch information
Showing
2 changed files
with
32 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters