Use request-specific context inside a global (singleton) service Use request-specific context inside a global (singleton) service express express

Use request-specific context inside a global (singleton) service


I ended up working around Nest.js, and it seems to work fine so far. Notice that we use it in an internal app, so we have a low concurrent user count, so YMMV.

The solution is based off of the asyncctx package, as suggested here. You can find the full solution here.