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
Copy file name to clipboardExpand all lines: README.md
+18-13Lines changed: 18 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -12,27 +12,32 @@ A small library for [AWS Lambda](https://aws.amazon.com/lambda/details) providin
12
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
13
* Simplifies writing lambda handlers (in nodejs)
14
14
* Lambda Proxy Resource support for AWS API Gateway
15
-
* Enable CORS for the requests
16
-
* No dependencies
17
-
* Currently there are two `processors` (caller for Lambda) implemented: API Gateway ANY method (called proxyIntegration) and SNS.
15
+
* Enable CORS for requests
16
+
* No external dependencies
17
+
* Currently there are two `processors` (callers for Lambda) implemented: API Gateway ANY method (called proxyIntegration) and SNS.
18
18
19
19
## Installation
20
-
Install via npm.
20
+
Install via npm
21
21
22
22
```
23
23
$ npm install aws-lambda-router
24
24
```
25
+
or yarn
26
+
27
+
```
28
+
$ yarn install aws-lambda-router
29
+
```
25
30
26
31
## Getting Started
27
32
28
-
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`.
33
+
This is a simple example of `aws-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 AWS API Gateway with a `GET` request on URL path `<base-url-of-gateway>/gateway-mapping/article/123`.
29
34
30
35
```js
31
36
constrouter=require('aws-lambda-router');
32
37
33
38
// handler for an api gateway event
34
39
exports.handler=router.handler({
35
-
// for handling an http-call from an AWS Apigateway proxyIntegration we provide the following config:
40
+
// for handling an http-call from an AWS API Gateway proxyIntegration we provide the following config:
To activate CORS on all http methods (OPTIONS requests are handled automatically) you only sets the parameter `cors` to `true`of the `proxyIntegration` rule.
60
+
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.
0 commit comments