Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/rodkranz/routing
Stupid Routing for AWS Lambdas :)
https://github.com/rodkranz/routing
Last synced: 5 days ago
JSON representation
Stupid Routing for AWS Lambdas :)
- Host: GitHub
- URL: https://github.com/rodkranz/routing
- Owner: rodkranz
- Created: 2018-06-13T23:27:51.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2022-12-07T17:06:20.000Z (about 2 years ago)
- Last Synced: 2024-11-07T22:42:24.518Z (about 2 months ago)
- Language: Go
- Size: 27.3 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- Changelog: CHANGELOG.md
Awesome Lists containing this project
README
Router
---Example:
```go
package mainimport (
"net/http""github.com/aws/aws-lambda-go/events"
"github.com/aws/aws-lambda-go/lambda"
"github.com/rodkranz/routing"
)const (
hello = "/hello"
)func main() {
r := routing.New()r.Register(http.MethodGet, hello, HandlerHelloWord)
lambda.Start(r.Lambda)
}func HandlerHelloWord(context routing.Context, proxy routing.RequestProxy) (i interface{}, e error) {
return events.APIGatewayProxyResponse{
StatusCode: http.StatusOK,
Body: string("Hello world"),
}, nil
}```