Skip to content

Routing

Tharanga edited this page Jun 2, 2018 · 3 revisions

Developer can create route endpoint by mentioning url, request method, the event which going to fire and some request mapping configurations. All these routing rules are used inside API Gateway.

Sample Routing Spec

name: users_route # route name just for identify
requestMethod: POST 
url: /users
async: true # enable asynchronous invocation
successResponseStatus: 201 # default response http status code
event: users.UserCreate # event going to send
requestMapping:
  - eventAttribute: eID # attribute name which funtion going to access in event's payload
    requestAttribute: id # attribute name which come in http request
  - eventAttribute: eName
    requestAttribute: name
headerMapping:
  - eventAttribute: auth # attribute name which funtion going to access in event's payload
    headerAttribute: x-token # attribute name which come in http header
headersToPass: # headers going to pass with event
  - Authorization
  - Private-Token

Manage Routes with quebic cli

Create Route
  • quebic route create --file [route spec file]
Update Route
  • quebic route update --file [route spec file]
List all Routes
  • quebic route ls
Inspect Route details
  • quebic route inspect --name [route name]