Skip to content

Commit

Permalink
update(other): 🧩 update
Browse files Browse the repository at this point in the history
update logic of InitEnv
  • Loading branch information
truong committed Jan 30, 2024
1 parent a65cac2 commit 40199cf
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions server/dist/utils/InitEnv.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ const PROCESS_ENV = (() => {
})

switch (exports.ENV_MODE) {
case 'development':
break
case 'staging':
dotenv.config({
path: _path2.default.resolve(__dirname, '../../.env.staging'),
Expand All @@ -57,6 +59,7 @@ const PROCESS_ENV = (() => {
path: _path2.default.resolve(__dirname, '../../.env.production'),
override: true,
})
break
}

return process.env
Expand Down
3 changes: 3 additions & 0 deletions server/src/utils/InitEnv.ts
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,8 @@ export const PROCESS_ENV = (() => {
})

switch (ENV_MODE) {
case 'development':
break
case 'staging':
dotenv.config({
path: path.resolve(__dirname, '../../.env.staging'),
Expand All @@ -63,6 +65,7 @@ export const PROCESS_ENV = (() => {
path: path.resolve(__dirname, '../../.env.production'),
override: true,
})
break
}

return process.env as IProcessENV
Expand Down

0 comments on commit 40199cf

Please sign in to comment.