Constants

Define constants in data/app.config.yaml:

version: v1.3
type: Config
body:
  constants:
    today: "2017-12-01"

You can use constants in a route YAML:

rules:
  ...
- response:
    headers:
      content-type: application/json
    body:
      - id: 1
        name: Foo
        registeredDate: ${constants.today}

The file name config.[yaml|yml] is reserved. You can still configure the project, but it will not support the manifest declaration. For config.yml you can declare settings in that way:

#data/config.yml
logging:
  headers: false
  body: false
constants:
  today: "2017-12-01"

Last updated