- Create a new Serverless service and change into the directory.
serverless create --template hello-world
- Install the plugin: (needs Node version 7+)
$ npm install --save-dev @serverless/serverless-event-gateway-plugin
- 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"
...
- Wire up your functions with an
eventgateway
event type:
# serverless.yml
...
functions:
hello:
handler: handler.hello
events:
- eventgateway:
event: http
path: /hello
method: GET
- Deploy