Last active
July 18, 2020 11:08
-
-
Save darwinsubramaniam/1ea4f0d1fea189842a5df706df9c168f to your computer and use it in GitHub Desktop.
Sample CouchdbService using registerAs as config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { Injectable, Inject} from '@nestjs/common'; | |
import databaseConfig from '../database.config'; | |
import { ConfigType } from '@nestjs/config'; | |
@Injectable() | |
export class CouchdbService{ | |
constructor( | |
@Inject(databaseConfig.KEY) | |
private config:ConfigType<typeof databaseConfig>) { } | |
testConsole = () => { | |
console.log(`${this.config.password`); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment