title: How to pass a POST request to the router pages in Express?
body: <p>I am receiving a POST request in the app.js file using <code>app.post('/index',function(req,res){
  //some code})</code>.
  How can I pass the request to one of my router pages (index.js)?</p>
  
  <p>My index.js file</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' });
  });
  
  module.exports = router;
  </code></pre>