Skip to content

Instantly share code, notes, and snippets.

@adnanrahic
Last active May 9, 2018 08:02
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
module.exports.login = async (event, context) => { // Lambda is async!
try {
const db = await connectToDatabase();
const session = await login(JSON.parse(event.body));
return {
statusCode: 200,
body: JSON.stringify(session)
};
} catch (error) {
console.error(error.stack);
return {
statusCode: 500,
body: JSON.stringify(error.message)
};
}
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment