From eec3a25c84ed8d0f7f9354f894d58c685e874018 Mon Sep 17 00:00:00 2001 From: Michael Taylor Date: Thu, 27 Jan 2022 13:30:05 -0500 Subject: [PATCH] feat: add default env --- package.json | 1 + src/models/database.js | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 3689d2ea..c1fda347 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "0.0.5", "private": true, "bin": "build/server.js", + "type": "module", "engines": { "node": ">=16.0.0" }, diff --git a/src/models/database.js b/src/models/database.js index c11d46ec..a8c92761 100644 --- a/src/models/database.js +++ b/src/models/database.js @@ -6,7 +6,8 @@ dotenv.config(); // possible values: local, test export const sequelize = new Sequelize(config[process.env.NODE_ENV || 'local']); -const mirrorConfig = process.env.NODE_ENV === 'local' ? 'mirror' : 'mirrorTest'; +const mirrorConfig = + (process.env.NODE_ENV || 'local') === 'local' ? 'mirror' : 'mirrorTest'; export const sequelizeMirror = new Sequelize(config[mirrorConfig]); export const safeMirrorDbHandler = (callback) => {