Skip to content

Instantly share code, notes, and snippets.

@mweagle mweagle/application.go
Last active Apr 11, 2016

What would you like to do?
Hello world for Medium
// File: application.go
package main
import (
sparta ""
// Hello world event handler
func helloWorld(event *json.RawMessage,
context *sparta.LambdaContext,
w http.ResponseWriter,
logger *logrus.Logger) {
logger.Info("Hello World: ", string(*event))
fmt.Fprint(w, string(*event))
// Main
func main() {
var lambdaFunctions []*sparta.LambdaAWSInfo
lambdaFn := sparta.NewLambda(sparta.IAMRoleDefinition{}, helloWorld, nil)
lambdaFunctions = append(lambdaFunctions, lambdaFn)
// Deploy it
"Simple Sparta application that creates a single AWS Lambda function",
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.