Created
March 21, 2021 21:44
-
-
Save kerren/3f7192abf91c78b4c3e8e8312fe8fb57 to your computer and use it in GitHub Desktop.
[Importing the config] A few ways to do it #config #import #nestjs
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
// 1. Import the full config object | |
import { Config } from '@config'; | |
console.log(Config.database); | |
// 2. Import a single "feature" | |
import { database } from '@config'; | |
// 3. Import the full config but as a namespace | |
import * as config from '@config'; | |
console.log(config.database); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment