This project is a demonstration on how to use AWS SAM local to simulate a local AWS API Gateway pointing to a local lambda function (using Go as runtime) for local development.
- Compile the
main.go
into a binary
GOOS=linux go build -o main
-
Install SAM Local
-
Start the SAM Local server
sam local start-api
- Access the API (
curl
needs to be installed)
curl -X POST -d world http://localhost:3000/products/test
You should see Hello world%
being returned.