Middleware
#2468
Replies: 1 comment
-
Yes, in your middleware you have full access to the context. You can use .get()/.set() to add variables in middleware that can be accessed by your routes. If you want it to only run on routes using app.post('/', myCustomMiddleware, (c) => {
// route logic
}) Or you can create a middleware for all routes that checks the |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
How do make middleware run only on POST functions?
I want functions to access a value I set in middleware. Is there particular place for that or can middleware just set it anywhere on
c
likec.value = "from middleware"
?Beta Was this translation helpful? Give feedback.
All reactions