Skip to content

Instantly share code, notes, and snippets.

@qoelet
Created September 7, 2010 05:22
Show Gist options
  • Save qoelet/567903 to your computer and use it in GitHub Desktop.
Save qoelet/567903 to your computer and use it in GitHub Desktop.
// A simple generic server for local testing
// point to local node libraries folder
require.paths.push('/usr/local/lib/node/');
var static = require('node-static');
var myfolder = 'dojo'; // change this if needed
var port = 8123; // change this if needed
var fileServer = new static.Server('./' + myfolder);
require('http').createServer(function(req, res) {
req.on('end', function() {
fileServer.serve(req, res);
});
}).listen(port);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment