AWS SAM Go lambda example
Installing the AWS SAM CLI on macOS
Installing the AWS SAM CLI on macOS
build
make build
Start Api
sam local start-api
Test diffrent functions/events
hello-world-api-get
curl http://localhost:3000
hello-world-api-get-query
curl -X GET -H 'content-type: application/json' http://localhost:3000/query?name=foo
hello-world-api-get-path-param
curl -X GET -H 'content-type: application/json' http://localhost:3000/path/foo
hello-world-api-post
curl -X POST -H "Content-Type:application/json" --data '{ "message": "world" }' http://localhost:3000
hello-world-api-put
curl -X PUT -H "Content-Type:application/json" --data '{ "message": "world" }' http://localhost:3000
hello-world-api-delete
curl -X DELETE http://127.0.0.1:3000