New config entry: swagger

This commit is contained in:
DarkCat09 2023-09-25 11:14:19 +04:00
parent 29e923cce6
commit 809a389b6a
No known key found for this signature in database
GPG Key ID: 0A26CD5B3345D6E3
2 changed files with 3 additions and 0 deletions

View File

@ -4,3 +4,4 @@ PORT=8080
REVERSE_PROXY=true # only for reverse proxy; see docs REVERSE_PROXY=true # only for reverse proxy; see docs
PROXY_RES=true PROXY_RES=true
SWAGGER=false # whether to add API docs route or not

View File

@ -5,6 +5,7 @@ export class ConfigService {
public readonly port: number; public readonly port: number;
public readonly reverse_proxy: boolean; public readonly reverse_proxy: boolean;
public readonly proxy_res: boolean; public readonly proxy_res: boolean;
public readonly swagger: boolean;
constructor() { constructor() {
config(); config();
@ -15,6 +16,7 @@ export class ConfigService {
this.reverse_proxy = this.parseBool(process.env.REVERSE_PROXY, false); this.reverse_proxy = this.parseBool(process.env.REVERSE_PROXY, false);
this.proxy_res = this.parseBool(process.env.PROXY_RES, true); this.proxy_res = this.parseBool(process.env.PROXY_RES, true);
this.swagger = this.parseBool(process.env.SWAGGER, false);
} }
parseBool(value: string | undefined, def: boolean): boolean { parseBool(value: string | undefined, def: boolean): boolean {