title: How to pass data between express routes?
body: <p>I'm making an API call in a <code>POST</code> route but for some reason, I can't pass the <code>JSON</code> data through <code>res.render</code> in the <code>POST</code> route. So I'm thinking about passing the JSON object to <code>GET</code> route so I can <code>render</code> it to the right client page.</p>
  
  <p>Heres my <code>GET</code> and <code>POST</code> routes:</p>
  
  <pre><code>router.get('/bookDetails', (req, res) =&gt; {
       res.render('bookDetails');
  });
  
  router.post('/bookDetails', (req, res) =&gt; {
       let ID = req.body.ID;
       request('https://www.googleapis.com/books/v1/volumes/' + ID, (err, response, body) =&gt; {
       if(!err &amp;&amp; response.statusCode == 200){
         let bookdata = JSON.parse(body);
         res.render('bookDetails', {bookdata: bookdata});
      }else{
        console.log(err);
      }
    });
  });
  </code></pre>
  
  <p>I can't read the bookdata in my bookDetails.ejs file? Is there another way pass this data to the page?</p>