I want to run a very simple HTTP server. Every GET request to example.com
should get index.html
served to it but as a regular HTML page (i.e., same
This is basically an updated version of the accepted answer for connect version 3:
var connect = require('connect');
var serveStatic = require('serve-static');
var app = connect();
app.use(serveStatic(__dirname, {'index': ['index.html']}));
app.listen(3000);
I also added a default option so that index.html is served as a default.