I am trying to use Embedded Javascript renderer for node. I installed it using npm, as given here: https://github.com/visionmedia/ejs
And I have the following code, but
try this: (assuming you have the express and ejs modules installed)
var express = require('express');
var app = express.createServer();
app.configure(function() {
app.use(express.bodyParser());
app.use(express.static('./static/'));
app.use(app.router);
});
app.set('view engine', 'ejs');
app.set('view options', {
layout: false
});
app.get('/', function(req, res) {
res.render('index', {
message : 'De groeten'
});
});
app.listen(3000);
and put a view in './views'. call it 'index.ejs' and fill it with some html:
<%= message %>
works for me!