Config (rivet.json)
Schema
ProjectConfig
extendsoptional stringExtends a different project config.
registriesoptional record of union of objectssmodulesrecord of objectsmodules.registryoptional stringThe name of the registry to fetch the module from.
modules.moduleoptional stringOverrides the name of the module to fetch inside the registry.
modules.configoptional record of objectsThe config that configures how this module is ran at runtime.
modules.storageAliasoptional stringUsed 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.
modules.routesoptional objectConfig options controlling how the routes are implemented and accessed.
modules.routes.pathPrefixoptional stringThe path prefix for all routes in this module.
runtimeoptional objectruntime.corsoptional objectruntime.cors.originsarray of stringsThe origins that are allowed to make requests to the server.
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 keymodules: replace module with same keyruntime: merge 1 level deep
Example
This example will override the lobbies config with a development config in rivet.dev.json.