Skip to content

Express middleware compatibility #1858

Closed Answered by peterroe
robokozo asked this question in Q&A
Discussion options

You must be logged in to vote

Hi, H3 is compatible with express middleware. For your case, you can do like this:

export default fromNodeMiddleware((req, res, next) => {
    myExpressMiddleware(req, res, next);
})

Or we could even make it simpler.

export default fromNodeMiddleware(myExpressMiddleware)

Replies: 3 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by robokozo
Comment options

You must be logged in to vote
0 replies
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