aws-sam-go-lambda-example

module
v0.0.0-...-1271216 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 16, 2019 License: MIT

README

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL