Advertisement
Guest User

Untitled

a guest
Oct 21st, 2016
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. //fetching all routes files.
  2. var api = require('./api');
  3. var routes = function(app) {
  4.  
  5.     app.get('/', function(req, res) {
  6.         res.render('index');
  7.     });
  8.     app.get('/partials/:name', function(req, res) {
  9.         var name = req.params.name;
  10.         res.render('view/' + name);
  11.     });
  12.     //Initilizing routes
  13.     api(app);
  14.  
  15.     // redirect all others to the index (HTML5 history)
  16.     app.get('*', function(req, res) {
  17.         res.render('index');
  18.     });
  19. };
  20.  
  21. module.exports = routes;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement