Created
April 27, 2013 10:02
-
-
Save chestozo/5472575 to your computer and use it in GitHub Desktop.
Run simple http server with http://www.senchalabs.org/connect/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // 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