Access current req object everywhere in Node.js Express

前端 未结 2 1265
别跟我提以往
别跟我提以往 2021-02-07 15:57

I wonder how to access req object if there\'s no \'req\' parameter in callback.

This is the scenario:
In ExpressJs, I have a common function, it uses to handle somet

2条回答
  •  刺人心
    刺人心 (楼主)
    2021-02-07 16:51

    Actually, this is possible with something like global-request-context

    This is using zone.js which let you persist variables across async tasks.

提交回复
热议问题