How should RouterMiddleware be used? #497
Answered
by
kitsonk
finlaydotb
asked this question in
Q&A
-
In an application using an older version of oak, the middleware get's plugged into the handler as follows:
Where
This no longer compiles. On further investigation I discovered it seems the middleware should now be typed as But when I updated
It now fails to compile with the following error:
Any ideas on how to fix this? |
Beta Was this translation helpful? Give feedback.
Answered by
kitsonk
Mar 22, 2022
Replies: 1 comment
-
Try: export const isAdmin: RouterMiddleware<"/path"> = async (ctx, next) => {
await next();
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
finlaydotb
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Try: