Skip to content

Instantly share code, notes, and snippets.

@brianneisler
Last active May 3, 2018 21:06
Show Gist options
  • Save brianneisler/a8eee79ef8439cbcb857247e1a686719 to your computer and use it in GitHub Desktop.
Save brianneisler/a8eee79ef8439cbcb857247e1a686719 to your computer and use it in GitHub Desktop.

Usage

  1. Create a new Serverless service and change into the directory.
serverless create --template hello-world
  1. Install the plugin: (needs Node version 7+)
$ npm install --save-dev @serverless/serverless-event-gateway-plugin
  1. Enter the necessary plugin and config in serverless.yml:
# serverless.yml

service: my-service

custom:
  eventgateway:
    url: [tenant name]-[app name].slsgateway.com
    accessKey: <yourkey>

plugins:
  - "@serverless/serverless-event-gateway-plugin"
...
  1. Wire up your functions with an eventgateway event type:
# serverless.yml
...
functions:
  hello:
    handler: handler.hello
      events:
        - eventgateway:
          event: http
          path: /hello
          method: GET            
  1. Deploy
serverless deploy
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment