ect icon indicating copy to clipboard operation
ect copied to clipboard

ExpressJS sample code

Open margani opened this issue 4 years ago • 0 comments

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?

margani avatar Jul 20 '20 16:07 margani