title: How to configure dynamic routes with express.js
body: <p>I have a route.js which looks like this:</p>
  
  <pre><code>module.exports = function(app) {
  
    app.get('/tip', function(req, res) {
      res.render("tip");
    });
  
    app.get('/article', function(req, res) {
     res.render("article");
    });
  
    app.get('/article1', function(req, res) {
     res.render("article1");
    });
  
    app.get('/article2', function(req, res) {
     res.render("article2");
    });
  
    app.get('/article3', function(req, res) {
     res.render("article3");
    });
  
    app.get('/modules/:name', function(req, res) {
      var name = req.params.name;
      res.render('modules/' + name);
    });
  
    app.get('/modules/esaver/:name', function(req, res) {
      var name = req.params.name;
      res.render('modules/esaver/' + name);
    });
  
  };
  </code></pre>
  
  <p>Considering i have over 200 different routes to create, i would end up with stuff like 'article1', 'article2' etc</p>
  
  <p>and my app.js is like:</p>
  
  <pre><code>var express = require('express')
    ,http = require('http')
    ,fs = require('fs')
    ,path = require('path');
  
  var app = express();
  
  html_templates = __dirname + '/html_templates';
  
  app.set('views', html_templates + '/views');
  app.set('view engine', 'jade');
  
  app.use('/Core', express.static(__dirname + '/Core'));
  
  
  app.listen(3000, function () {
   console.log("express has started on port 3000");
  });
  
  require('./html_templates/controller/routes.js')(app);
  </code></pre>
  
  <p>Is there any dynamic way to create this?</p>