Skip to content
Snippets Groups Projects
Commit 85e27950 authored by michael.minelli's avatar michael.minelli
Browse files

Config => refactor gitlab values

parent 58266dfc
Branches
Tags
No related merge requests found
import HttpManager from '../managers/HttpManager';
import getAppDataPath from 'appdata-path';
class Config {
private static _instance: Config;
private _apiURL!: string;
public 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();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment