Config (rivet.json)
Schema
ProjectConfig
extends
optional stringExtends a different project config.
registries
optional record of union of objectssmodules
record of objectsmodules.registry
optional stringThe name of the registry to fetch the module from.
modules.module
optional stringOverrides the name of the module to fetch inside the registry.
modules.config
optional record of objectsThe config that configures how this module is ran at runtime.
modules.storageAlias
optional 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.routes
optional objectConfig options controlling how the routes are implemented and accessed.
modules.routes.pathPrefix
optional stringThe path prefix for all routes in this module.
runtime
optional objectruntime.cors
optional objectruntime.cors.origins
array 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
.