Skip to content

Instantly share code, notes, and snippets.

@chestozo
Created April 27, 2013 10:02
Show Gist options
  • Save chestozo/5472575 to your computer and use it in GitHub Desktop.
Save chestozo/5472575 to your computer and use it in GitHub Desktop.
Run simple http server with http://www.senchalabs.org/connect/
// Run: node server.js
var app = connect()
.use(connect.bodyParser()) // handle post requests
.use(connect.static('http')) // serve files from http dir: ./http/file.html seen at http://host/file.html
.use(callback) // handle custom urls in standart function(req, res) { ... } callback
.listen(config.port || 3000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment