You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A small library providing routing for AWS ApiGateway Proxy Integrations and SNS...
8
+
A small library for [AWS Lambda](https://aws.amazon.com/lambda/details)providing routing for [API Gateway](https://aws.amazon.com/api-gateway)[Proxy Integrations](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-set-up-simple-proxy.html) and [SNS](https://aws.amazon.com/sns).
9
9
10
-
## Install
10
+
## Features
11
+
12
+
* Easy Handling of [ANY method](https://docs.aws.amazon.com/apigateway/latest/developerguide/api-gateway-method-settings-method-request.html#setup-method-add-http-method) in API Gateways
13
+
* Simplifies writing lambda handlers (in nodejs)
14
+
* Lambda Proxy Resource support for AWS API Gateway
15
+
* Enable CORS for the requests
16
+
17
+
## Installation
18
+
Install via npm.
11
19
12
20
```
13
21
$ npm install aws-lambda-router
14
22
```
15
23
24
+
## Getting Started
25
+
26
+
This is an simple using of `aws-lambda-router` in connection with ANY method and the API Gateway proxy Intergration. The following code will response with a message when executed using the AWS API Gateway with a `GET` request of URL path `<base-url-of-gateway/gateway-mapping/article/123`.
27
+
28
+
```js
29
+
constrouter=require('aws-lambda-router');
30
+
31
+
// handler for an api gateway event
32
+
exports.handler=router.handler(
33
+
{
34
+
// for handling an http-call from an AWS Apigateway proxyIntegration we provide the following config:
35
+
proxyIntegration: {
36
+
routes: [
37
+
{
38
+
// request-path-pattern with a path variable:
39
+
path:'/article/:id',
40
+
method:'GET',
41
+
// we can use the path param 'id' in the action call:
0 commit comments