This file contains 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
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