ect
ect copied to clipboard
Customization
Hi,
I don't know what I am doing wrong here...
var express = require('express'); var app = express(); var ect = require('ect'); var ectRenderer = ect({ watch: true, root: __dirname + '/app', ext : '.html' });
app.set('view engine', 'html'); app.engine('ect', ectRenderer.render);
app.get('/', function (req, res){ res.render('index'); });
app.listen(3000); console.log('Listening on port 3000');
Basically, what I am doing is trying to configure ectRenderer so that it looks into the app folder instead of views folder and look for files with html extension instead of ect extension. For some reason, this is not working. The framework is still looking inside views folder. So, basically the ectRenderer does not seem to have any effect.
Can someone help with this? What am I doing wrong here?
.Uday
I have not tried your configuration, but I would suggest, in case you didn't, to try running the app using the default command provided by Express, which in latest versions is something like: DEBUG=myAppName ./bin/www (issued from within the root of the app). From within /bin, if I use ./www, etcRenderer looks for different directories rather than those looked for when launching the app with ./bin/www