Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

multiple root folder #90

Open
qataruniversity opened this issue Apr 23, 2015 · 2 comments
Open

multiple root folder #90

qataruniversity opened this issue Apr 23, 2015 · 2 comments

Comments

@qataruniversity
Copy link

Can I add multiple root folder ?
I mean different folder containing ect templates and if yes, how can I do it?

@BilalBoulifa
Copy link

+1

@dsamms
Copy link

dsamms commented Aug 8, 2015

I use Express. Here is how I get ECT to work with multiple sub-directories.

APP

// 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 (in sub-directories)

router.use(function(req, res, next) {
res.app.set('views', __dirname);
next();
});

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants