Skip to content

Instantly share code, notes, and snippets.

@kerren
Created March 21, 2021 21:02
Show Gist options
  • Select an option

  • Save kerren/44b12190e3828c0a88fd3c74bb41375a to your computer and use it in GitHub Desktop.

Select an option

Save kerren/44b12190e3828c0a88fd3c74bb41375a to your computer and use it in GitHub Desktop.
[Current NestJS Config] The suggested process in the NestJS docs #current #suggested #config #nestjs
interface DatabaseConfig {
host: string;
port: number;
}
const dbConfig = this.configService.get<DatabaseConfig>('database');
// you can now use `dbConfig.port` and `dbConfig.host`
const port = dbConfig.port;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment