How to Pass Data Between Routes in Express
问题 Suppose I have this POST route which receives some data. app.post('/getData', function(req, res){ var retrievedData = req.body.exampleVariable; // Send data to GET method }); And I have this GET method which renders a page, but needs the data I retrieved in the POST method app.get('/displayData', function(req, res){ // Retrieve data from POST method and display it. res.render('/examplePage.ejs', {retrievedData : req.retrievedData}); }); What is the best way to pass the retrievedData variable