mirror of
https://github.com/mitchell/lambdarouter.git
synced 2025-10-26 12:05:27 +00:00
| examples/hello-world | ||
| .gitignore | ||
| .travis.yml | ||
| go.mod | ||
| go.sum | ||
| Gopkg.lock | ||
| Gopkg.toml | ||
| LICENSE | ||
| README.md | ||
| router.go | ||
| router_test.go | ||
lambdarouter
This package contains a router capable of routing many AWS Lambda API gateway requests to anything that implements the aws-lambda-go/lambda.Handler interface, all in one Lambda function. It plays especially well with go-kit's awslambda transport package. Get started by reading below and visiting the GoDoc reference.
Initializing a Router
r := lambdarouter.New("prefix/")
r.Get("hello/{name}", helloHandler)
r.Post("hello/server", helloHandler)
r.Delete("hello", lambda.NewHandler(func() (events.APIGatewayProxyResponse, error) {
return events.APIGatewayProxyResponse{
Body: "nothing to delete",
}, nil
}))
lambda.StartHandler(r)
Check out the examples/ folder for more fleshed out examples in the proper context.