Cleanest way to host static files using nodejs

Use built-in http module and ecstatic for middleware.

First, install ecstatic

npm install ecstatic

And the magic!

var http = require('http'),
    ecstatic = require('ecstatic');

http.createServer(ecstatic({root:'./'}))
    .listen(8080, '127.0.0.1');