Schema

ProjectConfig

Object containing the following properties:

PropertyDescriptionTypeDefault
extendsExtends a different project config.string
registriesObject with dynamic keys of type string and values of type Object with properties:
  • local: Object with properties:
    • directory: string
    • isExternal: boolean - If true, this will be treated like an external registry. This is important if multiple projects are using the same registry locally. Modules from this directory will not be tested, formatted, linted, and generate database migrations.
or Object with properties:
  • git: Object with properties:
    • url: string or Object with properties:
      • https: string
      • ssh: string
      - The URL to the git repository. If both HTTPS and SSH URL are provided, they will both be tried and use the one that works
    • directory: string
    • branch: string
    , Object with properties:
    • url: string or Object with properties:
      • https: string
      • ssh: string
      - The URL to the git repository. If both HTTPS and SSH URL are provided, they will both be tried and use the one that works
    • directory: string
    • tag: string
    or Object with properties:
    • url: string or Object with properties:
      • https: string
      • ssh: string
      - The URL to the git repository. If both HTTPS and SSH URL are provided, they will both be tried and use the one that works
    • directory: string
    • rev: string
{}
modulesObject with dynamic keys of type string and values of type Object with properties:
  • registry: string - The name of the registry to fetch the module from.
  • module: string - Overrides the name of the module to fetch inside the registry.
  • config: Object with dynamic keys of type string and values of type any (optional & nullable) - The config that configures how this module is ran at runtime.
  • storageAlias: string - Used to store data in a consistent location in case the module name changes. This is used to construct the Postgres database schema and actor identifiers. Changing this will effectively unlink all data stored in this module. Changing it back to the old value will restore the data.
  • routes: Object with properties:
    • pathPrefix: string - The path prefix for all routes in this module.
    - Config options controlling how the routes are implemented and accessed.
{}
runtimeObject with properties:
  • cors: Object with properties:
    • origins: Array<string> - The origins that are allowed to make requests to the server.

All properties are optional.

Extending Configs

Extending configs enables overriding settings from another backend config. This is useful in situations like:

  • Separating development & production configs
  • Separating staging & production configs

This can be done by passing the path to another JSON file to extend.

Merge Strategy

Configs are merged with:

  • registries: replace registry with same key
  • modules: replace module with same key
  • runtime: merge 1 level deep

Example

This example will override the lobbies config with a development config in backend.dev.json.