Skip to content

Nested Config in schema #78

@ksmithut

Description

@ksmithut

I didn't see this anywhere in the documentation, but is there a way to have nested config variables in the config schema definition? For example:

var config = require('convict')({
  loggly: {
    token: {
      doc: '',
      format: String,
      env: 'LOGGLY_TOKEN'
    },
    subdomain: {
      doc: '',
      format: String,
      env: 'LOGGLY_SUBDOMAIN'
    }
  }
});

edit: Or is there another way to go about this completely? My only requirement would be to not store the information in a file. I know I can do nested config there, but I want the schema functionality to get the config variables from environment variables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions