Skip to content

Instantly share code, notes, and snippets.

@ctompkinson
Last active March 26, 2018 09:24
Show Gist options
  • Save ctompkinson/3f622f6fc408b4d947039f1f8c90a75b to your computer and use it in GitHub Desktop.
Save ctompkinson/3f622f6fc408b4d947039f1f8c90a75b to your computer and use it in GitHub Desktop.
Running and testing go lambdas locally

Running and testing go lambdas locally

To run the lambda locally

_LAMBDA_SERVER_PORT=8001 go run wavefront_handler.go

To invoke the lambda

package main

import (
	"github.com/djhworld/go-lambda-invoke/golambdainvoke"
)

func main() {
	response, err := golambdainvoke.Run(8001, "payload")
	if err != nil {
		fmt.Println(err)
	}
	fmt.Println(response)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment