How can I use .html extensions in my view files instead of .ejs when using Parse.com Express.js?
I changed the EJS delimiters to <? and ?> because I'm used to them with PHP. This worked fine, but I cannot change the file extension for my files of the form:
I tried the following:
var express = require('express'); var ejs = require('ejs'); var app = express(); ejs.open = '<?'; ejs.close = '?>'; app.set('view engine', 'ejs'); app.engine('.html', ejs.renderFile); app.set('views', 'cloud/views'); app.use(express.bodyParser()); app.get('/', function(req, res) { res.render('Test', { message: 'Hello Express!' }); }); app.listen();
And I get an internal server error.
I also tried to exclude this line with the same result:
app.set('view engine', 'ejs');
source share