From 809a389b6a6d4a1f3268bd27eb6d51061b72d546 Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Mon, 25 Sep 2023 11:14:19 +0400 Subject: [PATCH] New config entry: swagger --- .env.example | 1 + src/config/config.service.ts | 2 ++ 2 files changed, 3 insertions(+) diff --git a/.env.example b/.env.example index 26f6507..5f3fb65 100644 --- a/.env.example +++ b/.env.example @@ -4,3 +4,4 @@ PORT=8080 REVERSE_PROXY=true # only for reverse proxy; see docs PROXY_RES=true +SWAGGER=false # whether to add API docs route or not diff --git a/src/config/config.service.ts b/src/config/config.service.ts index ec3e1a2..3ff93e3 100644 --- a/src/config/config.service.ts +++ b/src/config/config.service.ts @@ -5,6 +5,7 @@ export class ConfigService { public readonly port: number; public readonly reverse_proxy: boolean; public readonly proxy_res: boolean; + public readonly swagger: boolean; constructor() { config(); @@ -15,6 +16,7 @@ export class ConfigService { this.reverse_proxy = this.parseBool(process.env.REVERSE_PROXY, false); 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 {