Skip to content

Cannot get root/whole config #350

Open
@Javarome

Description

@Javarome

Issue type:

  • question
  • bug report
  • feature request
  • documentation issue

nestjs-config version
0.5.0

@nestjs/common+core or other package versions

  • @nestjs/common: 7.5.5
  • @nestjs/core: 7.5.5

Excepted behavior

serviceConfig.get() returns root/whole config object.

Actual behavior or outcome (for issue)

A parameter is mandatory to get a specific field of the config.

Replication/Example

I defined my config as a complex object with fields being sub-objects, etc.
and need to provide that object to another party (a database, some service, the frontend, whatever).

Today:

config = serviceConfig.get()

is not allowed.

and I'm constrained to break encapsulation by doing:

config = serviceConfig['internalConfig']

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