Created
June 29, 2013 22:07
-
-
Save bingeboy/5892871 to your computer and use it in GitHub Desktop.
BP for expressjs v3.x
This file contains 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
var app = require('express')() | |
, server = require('http').createServer(app) | |
, express = require('express') | |
, http = require('http') | |
, port = 3000; | |
/* | |
* Express : Configure | |
*/ | |
app.configure(function() { | |
app.use(app.router); | |
}); | |
server.listen(port); | |
console.log("server.listen on port: ", port); | |
/* | |
* Routes : Handles URL mapping | |
*/ | |
app.get('/', function (req, res) { | |
res.sendfile('./index.html'); | |
}); | |
/* | |
* Run Server | |
*/ | |
server.listen(app.get('port'), function(){ | |
console.log('Express server listening on port ' + port); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment