How to make an Express site without a template engine?

You could use commands below to install express-generator globally and then scaffold a project without a view engine

 npm install -g express-generator
 express newProject --no-view

If what you want is directly to serve static html files with the possibility to cache resources, while still being able to hit "/" and get index.html, then the answer is as easy as this:

var express = require('express');
var http = require('http');
var app = express();

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

http.createServer(app).listen(3000);

Gotcha: Html files including index.html must be inside /public folder instead of /views

Tags:

Express