Created
November 27, 2020 17:44
-
-
Save Kristian-Roopnarine/d3d5152ad19b2f6bf7b359cf4e1dfea5 to your computer and use it in GitHub Desktop.
example NODE_ENV
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
let dbURI; | |
if (process.env.NODE_ENV ==='development'){ | |
dbURI = process.env.DATABASE_LOCAL_DB | |
} | |
if (process.env.NODE_ENV ==='test'){ | |
dbURI = process.env.DATABASE_TEST_DB | |
} | |
if (process.env.NODE_ENV ==='production'){ | |
dbURI = process.env.DATABASE_PROD_DB | |
} | |
mongoose.connect(dbURI) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment