Router Promo
Buy Router Promo now!
You will receive your code to redeem in your account within minutes by eMail. In order not to miss out the mail, please check the spam or junk mail folder too!
Please note: The download link will be sent to you via delivery eMail after you order.
The features of Router Promo:
- Easy Handling of ANY method in API Gateways
- Simplifies writing lambda handlers (in nodejs > 8)
- Lambda Proxy Resource support for AWS API Gateway
- Enable CORS for requests
- No external dependencies - well, almost, only types of aws-lambda :-)
- Currently there are four processors (callers for Lambda) implemented:
- API Gateway ANY method (called proxyIntegration)
- SNS
- SQS
- S3
- Compatibility with Typescript >= 3.5
Getting Started
This is a simple example of lambda-router in conjunction with ANY method and the API Gateway proxy integration. The following code will respond with a message when executed using an API Gateway with a GET request on URL path <base-url-of-gateway>/gateway-mapping/article/123. The corresponding API Gateway Resource is /article/{articleId}.
Proxy path support (work in progress)
The proxy integration usually works using a path configured in the API gateway. For example: /article/{id}.
If you use the WIP proxy path support, the complete path will be used to match a route config in proxyIntegration. This can be used to build an Simple Proxy with API Gateway
Enable CORS
To activate CORS on all http methods (OPTIONS requests are handled automatically) you only need to set the parameter cors to true on the proxyIntegration rule.
Customizing CORS
To customize CORS for all routes pass any of the following options to the proxyIntegration cors property. If a property is not set then it will default to the above default CORS headers.