vendredi 6 mars 2015

router.get catch all kraken.js

In kranken.js the files are loaded alphabetically. I have this code under my controller/index.js



router.get('/*', function (req, res) {
console.log('in router get catchall');
var configName = 'development';
var view = 'index';
model.env = configName;
model.useSass = (configName === 'development' ? true : false);
res.render('index', model);

});


My issue is that all files name after index.js for ex: job.js which will contain a router.get too. Those router.get will never get executed as the one in index.js will catch it first. Is there a way to still have both router.get with a catch all and route specific one's too ?


Aucun commentaire:

Enregistrer un commentaire