Open davidpablosg opened 5 years ago
@davidpablosg It may be a different problem. httpContext middleware must use after body-parser.
reference: https://github.com/skonves/express-http-context/issues/4
I have write a tidy npm package http-request-context to do this, using async_hooks, u can try it.
I've configured the context on ExpressJs app as a dependency on startup and also set it up as global middleware for every request. The code works like a charm when using routing-controllers for Get, Put and Post But, using @Body decorator into a PUT/POST method, it becomes undefined. Also using body-parser, injecting decorator @json, the context get lost.
Working cases:
Not working cases: