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.gointo a binary
GOOS=linux go build -o main-
Install SAM Local
-
Start the SAM Local server
sam local start-api- Access the API (
curlneeds to be installed)
curl -X POST -d world http://localhost:3000/products/testYou should see Hello world% being returned.