open-index/open-npm huggingface dataset:
npm package: @growsari/sls-event-gateway-subscriber
Description: Serverless Plugin for Growsari Event Gateway Subscription
Latest version: 0.0.3


# Serverless Plugin - Event Gateway Subscriber

This Serverless Framework plugin will configure API Gateway connected Lambdas to subscribe to topics in the Growsari Event Bus

## Installation

`npm install --save @growsari/sls-event-gateway-subscriber`

## Enviroment Configuration

`EVENT_GATEWAY_URL` - Base URL of the Growsari Event Bus

## Usage

To use the plugin, add the following configurations in `serverless.yml` 
- Include the package in the `plugins`
- Add `event_gateway` as an event trigger for a function.
- Add `topic` as a topic name for the `event_gateway` event

```yml

# serverless.yml

service:  serviceName

provider:
  name:  aws
  runtime:  nodejs10.x

# Add package in plugins
plugins:
  -  "@growsari/sls-event-gateway-subscriber"

functions:
  notificationUrlforTopicName:
    handler: handler.process
    events:
      # Make sure an http event with a POST method is present
      - http:
          path: notify
          method: post
      # Add event_gateway as an event and a topic to subscribe to
      - event_gateway:
          topic:  topicName
```