Last active
May 24, 2019 15:53
-
-
Save apotox/8dc2e00f3a815697cf6f7e2fd436950b to your computer and use it in GitHub Desktop.
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
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