dbgeek / aws-sam-go-lambda-example

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

About

License:MIT License


Languages

Language:Go 65.1%Language:Makefile 34.9%