Skip to content

Instantly share code, notes, and snippets.

@alensiljak
Created October 16, 2012 15:05
Show Gist options
  • Save alensiljak/3899833 to your computer and use it in GitHub Desktop.
Save alensiljak/3899833 to your computer and use it in GitHub Desktop.
Minimal web server using Node-Static
var static = require('node-static');
//
// Create a node-static server instance to serve the current folder
//
var file = new(static.Server)(__dirname);
require('http').createServer(function (request, response) {
request.addListener('end', function () {
//
// Serve files!
//
file.serve(request, response);
});
}).listen(8080);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment