skonves / express-http-context

Get and set request-scoped context anywhere
MIT License
299 stars 26 forks source link

This is not working with post express request #31

Closed monishgithub closed 5 years ago

monishgithub commented 5 years ago

I setup a traced id in express.js httpContext.set('traceId', uuid.v4()) But when I try to fetch it using httpContext.get('traceId') it doesnt seem to work and gives me undefined for POST express request. It works fine for GET request. Not sure what is wrong with this

monishgithub commented 5 years ago

This middleware needs to be used after all the middlewares in the express.js and only then it will work