varexpress=require('express');varmulter=require('multer');varapp=express();app.configure(function(){app.set('port',process.env.PORT||3000);app.use(multer());});app.post('/parse',function(req,res){varfrom=req.body.from;vartext=req.body.text;varsubject=req.body.subject;varnum_attachments=req.body.attachments;for(i=1;i<=num_attachments;i++){varattachment=req.files['attachment'+i];// attachment will be a File object}});varserver=app.listen(app.get('port'),function(){console.log('Listening on port %d',server.address().port);});
varexpress=require('express');varapp=express();app.configure(function(){app.set('port',process.env.PORT||3000);app.use(express.bodyParser());});app.post('/event',function(req,res){varevents=req.body;events.forEach(function(event){// Here, you now have each event and can process them how you likeprocessEvent(event);});});varserver=app.listen(app.get('port'),function(){console.log('Listening on port %d',server.address().port);});