Skip to content

Commit 19f0b3a

Browse files
committed
Merge branch 'master' of github.com:horike37/serverless-apigateway-service-proxy
2 parents a2a4c14 + 627c583 commit 19f0b3a

File tree

1 file changed

+38
-4
lines changed

1 file changed

+38
-4
lines changed

README.md

Lines changed: 38 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,47 @@
1-
# Serverless Apigateway Service proxy
2-
The Serverless Framewrok plugin to support AWS service proxy integration of API Gateway
1+
![serverless](http://public.serverless.com/badges/v3.svg)
2+
3+
# Serverless ApiGateway Service Proxy(BETA)
4+
This Serverless Framewrok plugin supports the AWS service proxy integration feature of API Gateway. You can directly connect API Gateway to AWS services without Lambda. Currently, the plugin only supports Kinesis streams but will expand to other services.
5+
6+
## Install
7+
Run `npm install` in your Serverless project.
8+
9+
```
10+
$ npm install --save-dev serverless-apigateway-service-proxy
11+
```
12+
Add the plugin to your serverless.yml file
13+
14+
```yaml
15+
plugins:
16+
- serverless-apigateway-service-proxy
17+
```
318
419
## How to use
5-
Define something to setting of AWS services you want to integrate with under `custom > apiGatewayServiceProxy`
20+
Define settings of the AWS services you want to integrate under `custom > apiGatewayServiceProxy` and run `serverless deploy`.
621

722
### Kinesis
23+
Here is syntax for Kinesis proxy in serverless.yml.
824
```yaml
925
custom:
1026
apiGatewayServiceProxy:
1127
- kinesis:
12-
path: /kinesis/{streamname}
28+
path: /kinesis
29+
method: post
30+
streamName: { Ref: 'YourStream' }
31+
cors: true
32+
33+
resources:
34+
Resources:
35+
YourStream:
36+
Type: AWS::Kinesis::Stream
37+
Properties:
38+
ShardCount: 1
39+
```
40+
41+
Here is a sample request after deploying.
1342
```
43+
curl -XPOST https://xxxxxxx.execute-api.us-east-1.amazonaws.com/dev/kinesis -d '{"Data": "some data","PartitionKey": "some key"}' -H 'Content-Type:application/json'
44+
45+
```
46+
47+

0 commit comments

Comments
 (0)