Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
D
DojoCLI
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
UI
DojoCLI
Commits
85e27950
Commit
85e27950
authored
2 years ago
by
michael.minelli
Browse files
Options
Downloads
Patches
Plain Diff
Config => refactor gitlab values
parent
58266dfc
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
NodeApp/src/config/Config.ts
+8
-15
8 additions, 15 deletions
NodeApp/src/config/Config.ts
with
8 additions
and
15 deletions
NodeApp/src/config/Config.ts
+
8
−
15
View file @
85e27950
import
HttpManager
from
'
../managers/HttpManager
'
;
import
getAppDataPath
from
'
appdata-path
'
;
class
Config
{
private
static
_instance
:
Config
;
p
rivate
_
apiURL
!
:
string
;
p
ublic
apiURL
:
string
;
public
gitlab
:
{
apiURL
:
string
;
dojoAccountId
:
number
;
apiURL
:
string
dojoAccount
:
{
id
:
number
;
username
:
string
;
};
};
public
readonly
localConfig
:
{
...
...
@@ -20,7 +20,10 @@ class Config {
this
.
gitlab
=
{
apiURL
:
process
.
env
.
GITLAB_API_URL
||
''
,
dojoAccountId
:
Number
(
process
.
env
.
GITLAB_DOJO_ACCOUNT
)
||
0
dojoAccount
:
{
id
:
Number
(
process
.
env
.
GITLAB_DOJO_ACCOUNT_ID
)
||
-
1
,
username
:
process
.
env
.
GITLAB_DOJO_ACCOUNT_USERNAME
||
''
}
};
this
.
localConfig
=
{
...
...
@@ -29,16 +32,6 @@ class Config {
};
}
get
apiURL
():
string
{
return
this
.
_apiURL
;
}
set
apiURL
(
url
:
string
)
{
this
.
_apiURL
=
url
;
HttpManager
.
API_BASE_URL
=
this
.
_apiURL
;
}
public
static
get
instance
():
Config
{
if
(
!
Config
.
_instance
)
{
Config
.
_instance
=
new
Config
();
...
...
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