Skip to content

Commit

Permalink
backend: Added and applied development.env file when dev mode
Browse files Browse the repository at this point in the history
  • Loading branch information
CSantosM committed Nov 7, 2024
1 parent 8bf6475 commit ada7877
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,4 @@ Thumbs.db


backend/public/
backend/development.env
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
4 changes: 4 additions & 0 deletions backend/src/config.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down

0 comments on commit ada7877

Please sign in to comment.