DEV Community

Himi Kansal
Himi Kansal

Posted on

(Nest JS)How to use custom config service in module.ts class to register with database

I have created a custom config service in nestjs which I want to use in another Database package to get database connection values.

The problem is I am not able to use my getConfig method of config-service class in module.ts file.

Please help.

Top comments (2)

Collapse
 
sanjayttg profile image
Sanjay Arya

You will need to export your provider, so that other module can import and make use of it. Please have a look at the NestJS Official Documentation, Export Custom Provider

Collapse
 
himikansal profile image
Himi Kansal

Hi, I have added another post with detailed description. Please look into that post.

Title of the post :- (Nest JS)How to get values from custom config service in module.ts class to register with database