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

ExpressJS sample code #109

Open
margani opened this issue Jul 20, 2020 · 0 comments
Open

ExpressJS sample code #109

margani opened this issue Jul 20, 2020 · 0 comments

Comments

@margani
Copy link

margani commented Jul 20, 2020

I had to add the following to the sample code to make it work:

app.set('views', path.join(__dirname, "views"));

Here is the sample code for using with express:

var express = require('express');
var app = express();
var ECT = require('ect');
var ectRenderer = ECT({ watch: true, root: __dirname + '/views', ext : '.ect' });

app.set('view engine', 'ect');
app.engine('ect', ectRenderer.render);

app.get('/', function (req, res){
	res.render('index');
});

app.listen(3000);
console.log('Listening on port 3000');

Shall we update it?

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

1 participant