How do I use HTML as the view engine in Express?

express, html, node.js

Solution

The answers at the other link will work, but to serve out HTML, there is no need to use a view engine at all, unless you want to set up funky routing. Instead, just use the static middleware:

app.use(express.static(__dirname + '/public'));

Problem

I tried this simple change from the seed and created the corresponding .html files (e.g. index.html). ``` //app.set('view engine', 'jade'); app.set('view engine', 'html'); ``` and this file remained the same: ``` exports.index = function(req, res){ res.render('index'); }; ``` but while running I get 500 Error: Cannot find module 'html' Is my only option to use 'ejs'? My intent was to use plain HTML in conjuction with AngularJS.

Original source

Related problems