Skip to content

How should RouterMiddleware be used? #497

Answered by kitsonk
finlaydotb asked this question in Q&A
Discussion options

You must be logged in to vote

But when I updated isAdmin to use RouterMiddleware like this:

export const isAdmin = async (ctx: RouterMiddleware<"/path">, next: Function) => {
    await next();
}

Try:

export const isAdmin: RouterMiddleware<"/path"> = async (ctx, next) => {
    await next();
}

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by finlaydotb
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #496 on March 22, 2022 23:40.