Skip to content

Instantly share code, notes, and snippets.

@darwinsubramaniam
Last active July 18, 2020 11:08
Show Gist options
  • Save darwinsubramaniam/1ea4f0d1fea189842a5df706df9c168f to your computer and use it in GitHub Desktop.
Save darwinsubramaniam/1ea4f0d1fea189842a5df706df9c168f to your computer and use it in GitHub Desktop.
Sample CouchdbService using registerAs as config
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