Skip to content

Instantly share code, notes, and snippets.

@bingeboy
Created June 29, 2013 22:07
Show Gist options
  • Save bingeboy/5892871 to your computer and use it in GitHub Desktop.
Save bingeboy/5892871 to your computer and use it in GitHub Desktop.
BP for expressjs v3.x
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