File size: 419 Bytes
bd98362
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
module.exports = function (app) {
    app.all('/*', function (req, res, next) {
        var arbitraryUrls = ['partials', 'api'];
        if (arbitraryUrls.indexOf(req.url.split('/')[1]) > -1) {
            next();
        } else {
            res.render('layout');
        }
    });
    
    app.get('/partials/*', function (req, res, next) {
        res.render('.' + req.path, { title: 'Fakedata.org' });
    });
};