Create a gist now

Instantly share code, notes, and snippets.

Embed
What would you like to do?

How Sails merges configuration files together

Given the following configuration files:

  • config/foo.js --> module.exports = {foo: {y:6}, bar: {y: 4}, baz: {y:4} }
  • config/local.js --> module.exports = {foo: {z: 2, x: -1}, bar: {z: 9}, baz: {z: 3}}
  • config/bar.js --> module.exports = {foo: {x: 9}, bar: {x:3}, baz: {x:8}}

Here's what you can expect to find in sails.config.*:

sails.config.foo
{
  x: -1,
  y: 6,
  z: 2
}
sails.config.bar
{
  x: 3,
  y: 4,
  z: 9
}
sails.config.baz
{
  x: 8,
  y: 4,
  z: 3
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment