Try your code like this:
var app = express();
app.get('/test', function(req, res) {
res.sendFile('views/test.html', {root: __dirname })
});
-
Use res.sendFile instead of reading the file manually so express can handle setting the content-type properly for you.
-
You don’t need the
app.engineline, as that is handled internally by express.