Friday 6 October 2017

Storing database query results globally

Is there a way to store database query results globally so that you can use it in other routes?For examplevar results; app.get('/dbresults', function(req, resp) { // database stuff results = result; }); app.get('/index', function(req, resp) { // a different db query var indexresult = result; }); So that in the /index route, I have 2 objects to use?

Submitted October 06, 2017 at 05:10AM by eggtart_prince

No comments:

Post a Comment