Skip to content

Instantly share code, notes, and snippets.

@jlandure
Created July 4, 2014 07:13
Show Gist options
  • Select an option

  • Save jlandure/80e92ae0e424a303fc69 to your computer and use it in GitHub Desktop.

Select an option

Save jlandure/80e92ae0e424a303fc69 to your computer and use it in GitHub Desktop.
node js simple server
var static = require('node-static');
//
// Create a node-static server instance to serve the './public' folder
//
var file = new static.Server('.');
require('http').createServer(function (request, response) {
request.addListener('end', function () {
//
// Serve files!
//
file.serve(request, response);
}).resume();
}).listen(8081);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment