Last active
March 24, 2016 07:31
-
-
Save jmathai/a3553a666e60cd0d3bc8 to your computer and use it in GitHub Desktop.
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 Response = require('joule-node-response'); | |
var JouleNodeDatabase = require('joule-node-database'); | |
exports.handler = function(event, context) { | |
var response = new Response(); | |
var database = new JouleNodeDatabase(); | |
database.get('hasInvite') | |
.done(function(data) { | |
if(typeof(data.hasInvite) === 'undefined' || data.hasInvite !== true) { | |
response.setHttpStatusCode(404); | |
response.send('Invitation not found.'); | |
} else { | |
response.setHttpStatusCode(200); | |
response.send('Yay! We found your invitation.'); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment