Created
June 14, 2018 02:07
-
-
Save SamanShafigh/820ed36dc42fd9cb8d2852debc586fb9 to your computer and use it in GitHub Desktop.
Sample hello world Lambda GO
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
package main | |
import "github.com/aws/aws-lambda-go/lambda" | |
type Event struct { | |
Payload string `json:"payload"` | |
} | |
func HandleRequest(e Event) (Event, error) { | |
return Event{"Hello World"}, nil | |
} | |
func main() { | |
lambda.Start(HandleRequest) | |
} |
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
'use strict'; | |
module.exports.hello = (event, context, callback) => { | |
const response = { | |
payload: "Hello World", | |
}; | |
callback(null, response); | |
}; | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment