title: Express JS on form submit stay on page
body: <p>I know this might be a simple question and has a tutorial somewhere but I can't seem to find it.
  I generated an app using <code>express-generator</code>and i added a simple form to a route</p>
  
  <p><strong>views/form.ejs</strong></p>
  
  <pre><code>&lt;div&gt;
  &lt;h1&gt;This is &lt;%= name %&gt;&lt;/h1&gt;
  &lt;form action="/form" method="POST"&gt;
      &lt;input type="text" name="question" placeholder="question"&gt;&lt;br&gt;
      &lt;input type="text" name="answer" placeholder="answer"&gt;&lt;br&gt;
      &lt;input type="submit"&gt;
  &lt;/form&gt;
  </code></pre>
  
  <p></p>
  
  <p>what i am trying to do is process the request after the form submission without doing anything to the page. Basically I want it to stay the same so I tried the following</p>
  
  <p><strong>routes/index.js</strong></p>
  
  <pre><code>var express = require('express');
  var router = express.Router();
  
  /* GET home page. */
  router.get('/', function(req, res, next) {
    res.render('index', { title: 'Express' });
  });
  
  router.get('/form', function (req, res) {
      res.render('form', {name: "My Name"});
  });
  
  router.post('/form', function (req, res) {
      console.log(req.body);
  });
  
  module.exports = router;
  </code></pre>
  
  <p>what happens is that the browser keeps waiting for a response from the server. I tried adding <code>next()</code> but it gives an error, I also tried returning from the function with no use.
  So how can I make a post request or handle any route in general without responding to the client?</p>