Skip to content

Commit

Permalink
Added: set port & setting methods to Config class (ritwickdey#328)
Browse files Browse the repository at this point in the history
  • Loading branch information
Almo7aya committed Mar 4, 2019
1 parent 9b8c241 commit b5375a0
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/Config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,10 @@ export class Config {
return Config.configuration.get(val) as T;
}

private static setSettings(key: string, val: number, isGlobal: boolean = false): Thenable<void> {
return Config.configuration.update(key, val, isGlobal);
}

public static get getHost(): string {
return Config.getSettings<string>('host');
}
Expand All @@ -37,6 +41,10 @@ export class Config {
return Config.getSettings<number>('port');
}

public static setPort(port: number): Thenable<void> {
return Config.setSettings('port', port);
}

public static get getRoot(): string {
return Config.getSettings<string>('root');
}
Expand Down

0 comments on commit b5375a0

Please sign in to comment.