Created
June 4, 2012 01:36
-
-
Save theycallmeswift/2865806 to your computer and use it in GitHub Desktop.
Hack the Midwest Livecode Demo
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
var express = require('express') | |
, app = express.createServer() | |
, SendGrid = require('sendgrid').SendGrid | |
, sendgrid = new SendGrid("hackthemidwest", "hackthemidwest"); | |
app.get('/swiftIsAwesome', function(req, res) { | |
sendgrid.send({ | |
to: "[email protected]", | |
from: "[email protected]", | |
subject: "SendGrid is easy to use and awesome", | |
text: "Trust me, if this email goes through (which it will), then I'm right" | |
}, function(success, response) { | |
if(!success) { | |
res.send("OOPS. Swift messed up, and here's why: " + response); | |
} else { | |
res.send("Email Sent"); | |
} | |
}); | |
}); | |
app.listen(3000); | |
app.on("listening", function() { | |
console.log("I AM LISTENING"); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment