App Configuration

Configuration Files

⚠️ Note: If you use Helm this information does not apply to you. We use Helm to automatically configure the application for you. Within helm you can manually alter this configuration in infrastructure/helm/bailo/templates/bailo/bailo.configmap.yaml

Bailo uses node-config for application configuration. node-config organizes hierarchical configurations, allowing the user to set a series of overides over a base configuration.

The default set of configuration can be found in config/default.js, with overrides for other environments included in the same folder. For production environments, configuration should be placed in either production.cjs or local.js to override the default configuration.

The full order of configuration inheritance can be found on the node-config wiki.

Given the following set of files:

// default.js
{ a: 5, b: "ten", c: { d: 20, e: 25 } }

// production.cjs
{ b: 10, c: { d: "d" } }

// local.js
{ c: { d: 999 } }

The result is:

{
  a: 5, // no overrides
  b: 10, // overridden in production.cjs
  c: {
    d: 999, // overriden in production.cjs, then again in local.js
    e: 25 // not overwritten, objects are merged together.
  }
}

When deploying using helm, configuration is primarily handled through values.yaml controlling helm/bailo/templates/bailo/bailo.configmap.yaml. Configuration is loaded when the application starts. The application must be restarted when configuration changes.


Copyright © Crown Copyright 2024.