title: Reload page in Node.js using Express and EJS
body: <p>I'm trying to reload the browser page when the underlying data model changes:</p>
  
  <pre><code>var request = require('request');
  var express = require('express');
  var app = express();
  var bodyParser = require('body-parser');
  
  app.set('view engine', 'ejs');
  app.use(bodyParser.urlencoded({ extended: false }));
  
  var requests;
  
  app.get('/', function(req, res) {
      res.render('index', {
          requests: requests
      });
  });
  
  app.listen(3000);
  </code></pre>
  
  <p>...and later when requests data model changes:</p>
  
  <pre><code>request.get('localhost:3000/', function(error, response, body) {
      console.log(body);
  });
  </code></pre>
  
  <p>but my browser page doesn't refresh unless I manually tap the refresh button with my mouse. What am I missing?</p>
  
  <p><strong>EDIT</strong>: Here is my <code>index.ejs</code> code:</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
  
  &lt;ul&gt;
      &lt;% requests.forEach(function(match) { %&gt;
          &lt;form action="/acceptRequest" method="post" enctype="application/x-www-form-urlencoded"&gt;
              &lt;input type="text" name="id" value="&lt;%= match.id %&gt;"&gt;
              &lt;input type="text" name="fighter1" value="&lt;%= match.fighter1 %&gt;"&gt; vs.
              &lt;input type="text" name="fighter2" value="&lt;%= match.fighter2 %&gt;"&gt; on
              &lt;input type="text" name="fightdate" value="&lt;%= match.date %&gt;"&gt; in
              &lt;input type="text" name="rounds" value=""&gt;
              &lt;input type="submit" value="Submit"&gt;
          &lt;/form&gt;
          &lt;br&gt;
          &lt;% }); %&gt;
  &lt;/ul&gt;
  
  &lt;/html&gt;
  </code></pre>