Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DojoBackendAPI
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
External wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Dojo Project (HES-SO)
Projects
Backend
DojoBackendAPI
Commits
29c797c7
Commit
29c797c7
authored
1 year ago
by
michael.minelli
Browse files
Options
Downloads
Patches
Plain Diff
App => Load env file for dev or prod
parent
823f8052
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
ExpressAPI/src/app.ts
+12
-2
12 additions, 2 deletions
ExpressAPI/src/app.ts
with
12 additions
and
2 deletions
ExpressAPI/src/app.ts
+
12
−
2
View file @
29c797c7
require
(
'
dotenv
'
).
config
();
// ATTENTION : This line MUST be the first of this file
// Read from the .env file
require
(
'
./shared/helpers/TypeScriptExtensions
'
);
// ATTENTION : This line MUST be the second of this file
// ATTENTION : This lines MUST be the first of this file (except for the path import)
const
path
=
require
(
'
node:path
'
);
if
(
process
.
env
.
NODE_ENV
&&
process
.
env
.
NODE_ENV
===
'
production
'
)
{
require
(
'
dotenv
'
).
config
();
}
else
{
require
(
'
dotenv
'
).
config
({
path
:
path
.
join
(
__dirname
,
'
../.env.keys
'
)
});
require
(
'
dotenv
'
).
config
({
DOTENV_KEY
:
process
.
env
.
DOTENV_KEY_DEVELOPMENT
});
}
require
(
'
./shared/helpers/TypeScriptExtensions
'
);
// ATTENTION : This line MUST be after the dotenv.config() calls
import
WorkerRole
from
'
./process/WorkerRole
'
;
import
WorkerRole
from
'
./process/WorkerRole
'
;
import
ClusterManager
from
'
./process/ClusterManager
'
;
import
ClusterManager
from
'
./process/ClusterManager
'
;
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment