Skip to content

Commit

Permalink
Add better logging when setting custom env var using .env
Browse files Browse the repository at this point in the history
  • Loading branch information
Jareechang committed Mar 16, 2019
1 parent 3f51f59 commit 6939559
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -37,3 +37,5 @@ Thumbs.db
# Ignore built ts files
dist/**/*

# ignore yarn.lock
yarn.lock
6 changes: 5 additions & 1 deletion src/util/secrets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ if (!SESSION_SECRET) {
}

if (!MONGODB_URI) {
logger.error("No mongo connection string. Set MONGODB_URI environment variable.");
if (prod) {
logger.error("No mongo connection string. Set MONGODB_URI environment variable.");
} else {
logger.error("No mongo connection string. Set MONGODB_URI_LOCAL environment variable.");
}
process.exit(1);
}

0 comments on commit 6939559

Please sign in to comment.