I\'m using this to have Node.js/Express setup as a rudimentary web server - it just serves a set of static pages without any other processing. I\'d like it to always serve /
I looked briefly for the best practices for serving a public folder and specifying the default page to serve. After reviewing the 'Express middleware' documentation, my solution looks like the following,
var express = require('express');
var app = express();
var options = {
index: "coming-soon.html"
};
app.use('/', express.static('app', options));
var server = app.listen(8081, function () {
var host = server.address().address;
var port = server.address().port;
console.log('my app is listening at http://%s:%s', host, port);
});