Skip to content

Instantly share code, notes, and snippets.

@tarqd
Created February 17, 2014 18:16
Show Gist options
  • Save tarqd/9056038 to your computer and use it in GitHub Desktop.
Save tarqd/9056038 to your computer and use it in GitHub Desktop.
/*!
* Module dependencies
*/
var express = require('express');
var http = require('http');
var path = require('path');
/*!
* Application
*/
var app = express();
app.set('port', process.env.PORT || 3000);
app.use(express.logger('dev'));
app.use(express.bodyParser());
// development only
if ('development' == app.get('env')) {
app.use(express.errorHandler());
}
// Handle callbacks
app.post('/callback', function (req, res) {
var data = req.body;
// do something with the e-mail data
res.end();
})
// start her up!
http.createServer(app).listen(app.get('port'), function(){
console.log('Express server listening on port ' + app.get('port'));
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment