template to return a generated body. See the examples under examples/templating.Example Configuration
api:
port: 2000
flow:
- template:
contentType: application/json
src: '{ "status": "ok" }'
- return:
status: 200
api:
port: 2000
flow:
- template:
contentType: application/json
src: '{ "status": "ok" }'
- return:
status: 200
Syntax
return:
contentType: <string>
status: <int>return: contentType: <string> status: <int>
Attributes
| Name | Required | Default | Description | Examples |
|---|---|---|---|---|
| contentType | false | null | Content-Type of the response. When unset, an existing response's Content-Type is left unchanged; only when a new response is built from the request is the request's Content-Type used if present, otherwise none is set. | application/json; charset=utf-8 |
| status | false | 200 | HTTP status code to be returned. | 400 |