Skip to content

Instantly share code, notes, and snippets.

@jmathai
Last active March 24, 2016 07:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jmathai/a3553a666e60cd0d3bc8 to your computer and use it in GitHub Desktop.
Save jmathai/a3553a666e60cd0d3bc8 to your computer and use it in GitHub Desktop.
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