Skip to content

Instantly share code, notes, and snippets.

View AshanthaLahiru's full-sized avatar
🎯
Focusing

Ashantha Lahiru AshanthaLahiru

🎯
Focusing
View GitHub Profile
@AshanthaLahiru
AshanthaLahiru / typical_promise.js
Last active April 29, 2018 11:49
Typical promise
let promise = (time) => {
return new Promise((res, rej) => {
console.log(`Promise ${time} start`)
setTimeout(() => {
res(`Promise ${time} end`)
}, time)
})
}
# Welcome to Serverless!
#
# This file is the main config file for your service.
# It's very minimal at this point and uses default values.
# You can always add more config options for more control.
# We've included some commented out config examples here.
# Just uncomment any of them to get that config option.
#
# For full config options, check the docs:
# docs.serverless.com
'use strict';
module.exports.hello = (event, context, callback) => {
const response = {
statusCode: 200,
body: JSON.stringify({
message: 'Go Serverless v1.0! Your function executed successfully!',
input: event,
}),
};