Reputation: 14800
Is it possible to get the current request object in node.js express without passing it around?
I'm looking for something like I know from the spring framework.
Something like:
var req = express.getCurrentRequest();
Upvotes: 1
Views: 597
Reputation: 3333
No it is possible to get the current request being served without passing it around. Your express server may be serving more than one request at any point of time and since Node.js is single threaded it is not possible to get hold of any specific request being served.
Upvotes: 2