TypeError: this.engine is not a function when trying to use Moustache in Express JS
问题 As the first thing I ever try on NodeJS, I'm building a simple app that displays a HTML page which tells visitors their IP address. Here's how it looks like var express = require('express'); var app = express(); app.set('view engine', 'mu2'); app.get('/', function (req, res) { res.setHeader('Content-Type', 'text/html'); // Do I have to do this? I'm not sure. res.render('frontPage.html', { ip: req.ip }); res.send(); }); app.listen(8080, function() { console.log("Listening on port 8080"); });