Skip to content

Handler doesn't recognize updated data #4961

Answered by richcorbs
richcorbs asked this question in Q&A
Discussion options

You must be logged in to vote

I think I figured this out with help from a friend.

var data = { abc: 123 }
const app = app.express()
function mw1(req, res, send) {
    req.data = data
    next()
}
function mw3(req, res, next) {
    mw2(req.data)(req, res)
    next()
}
app.use('/endpoint', mw1, mw3)

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by richcorbs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
1 participant