Skip to content

Instantly share code, notes, and snippets.

@dirkk0
Last active December 26, 2015 13:09
Show Gist options
  • Select an option

  • Save dirkk0/7156731 to your computer and use it in GitHub Desktop.

Select an option

Save dirkk0/7156731 to your computer and use it in GitHub Desktop.
static web server in node
var static = require('node-static');
var file = new static.Server('./public');
require('http').createServer(function (request, response) {
request.addListener('end', function () {
file.serve(request, response);
}).resume();
}).listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment