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();
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();
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.