Skip to content

Instantly share code, notes, and snippets.

@apotox
Last active May 24, 2019 15:53
Show Gist options
  • Save apotox/8dc2e00f3a815697cf6f7e2fd436950b to your computer and use it in GitHub Desktop.
Save apotox/8dc2e00f3a815697cf6f7e2fd436950b to your computer and use it in GitHub Desktop.
exports.handler = function(event, context, callback) {
// your server-side functionality
callback(null,{
statusCode: 200,
body: `hi , my name is Safi @saphidev`
})
}
//or async function
exports.handler = async function(event, context) {
// your server-side functionality
try{
let result = await someAmazingPromise()
return {
statusCode: 200,
body: `hi , my twitter is @saphidev`
}
}catch(err){
return {
statusCode: 400,
body: `there is an error,no problem ;) my twitter is @saphidev`
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment