This Go package contains an HTTP (AWS API Gateway) router for use in an AWS Lambda function.
Go to file
mitchell f65f17158c First iteration of v1 lambdarouter, full API change 2019-04-07 15:22:26 -07:00
examples/hello-world First iteration of v1 lambdarouter, full API change 2019-04-07 15:22:26 -07:00
.gitignore Initial commit of lambdarouter package including first iteration created; no docs; no tests as of yet 2018-07-13 14:12:31 -07:00
.travis.yml First iteration of v1 lambdarouter, full API change 2019-04-07 15:22:26 -07:00
Gopkg.lock First iteration of v1 lambdarouter, full API change 2019-04-07 15:22:26 -07:00
Gopkg.toml First iteration of v1 lambdarouter, full API change 2019-04-07 15:22:26 -07:00
LICENSE Create LICENSE file 2018-07-13 14:24:03 -07:00
README.md First iteration of v1 lambdarouter, full API change 2019-04-07 15:22:26 -07:00
go.mod First iteration of v1 lambdarouter, full API change 2019-04-07 15:22:26 -07:00
go.sum First iteration of v1 lambdarouter, full API change 2019-04-07 15:22:26 -07:00
router.go First iteration of v1 lambdarouter, full API change 2019-04-07 15:22:26 -07:00
router_test.go First iteration of v1 lambdarouter, full API change 2019-04-07 15:22:26 -07:00

README.md

lambdarouter

GoDoc Reference Build Status Test Coverage Maintainability Go Report Card

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.