diff --git a/.gitignore b/.gitignore index ec15f949..727c7312 100644 --- a/.gitignore +++ b/.gitignore @@ -55,3 +55,4 @@ Thumbs.db backend/public/ +backend/development.env diff --git a/backend/package.json b/backend/package.json index 2931481b..41dfd772 100644 --- a/backend/package.json +++ b/backend/package.json @@ -23,7 +23,7 @@ "scripts": { "build": "tsc", "start": "node dist/src/server.js", - "dev:start": "cross-env USE_HTTPS=false SERVER_CORS_ORIGIN=* nodemon -I --exec node --experimental-specifier-resolution=node --loader ts-node/esm ./src/server.ts", + "dev:start": "cross-env USE_HTTPS=false NODE_ENV=development nodemon -I --exec node --experimental-specifier-resolution=node --loader ts-node/esm ./src/server.ts", "lint": "eslint src --fix", "format": "prettier --ignore-path .gitignore --write '**/*.{ts,js,json,md}'", "pack": "npm pack" diff --git a/backend/src/config.ts b/backend/src/config.ts index f9e17bc3..1e2ea5b5 100644 --- a/backend/src/config.ts +++ b/backend/src/config.ts @@ -1,5 +1,9 @@ import dotenv from 'dotenv'; +if (process.env.NODE_ENV === 'development') { + dotenv.config({ path: 'development.env' }); +} + if (process.env.CALL_CONFIG_DIR) { dotenv.config({ path: process.env.CALL_CONFIG_DIR }); } else {