How to render a page following a GET request node js
<p>I am working on express js and a particular endpoint renders the page using </p>

<pre><code>res.render('dialog',{state:'admin'});
</code></pre>

<p>This endpoint is at <a href="http://localhost:3000/api/login" rel="nofollow">http://localhost:3000/api/login</a>. When i open this link in the browser, it opens the dialog.ejs page but when i call this endpoint using a GET request from another part of the server, the dialog.ejs page is not rendered</p>

<pre><code>request({
    url: 'http://localhost:3000/api/login',
    headers:{
      'Authorization' : auth
    }, 
    method: 'GET'
}, function(err, response, body) {
    console.log("Response to request for authorization code : " + response.statusCode);
});
</code></pre>

<p>Please help !</p>