Open qataruniversity opened 9 years ago
+1
I use Express. Here is how I get ECT to work with multiple sub-directories.
// View Engine setup var ECT = require('ect'); // NOTE: always watch, otherwise directory changes are not detected var ectRenderer = ECT({ watch: true, root: path.join(dirname, 'src') }); app.engine('.ect', ectRenderer.render); app.set('view engine', 'ect'); app.set('views root', path.join(dirname, 'src'));
router.use(function(req, res, next) { res.app.set('views', __dirname); next(); });
Can I add multiple root folder ? I mean different folder containing ect templates and if yes, how can I do it?