refactor(server): bootstrap and middleware read config via app-config

This commit is contained in:
jubnl
2026-07-25 15:17:33 +02:00
parent e17f165e44
commit a34ab288f5
9 changed files with 45 additions and 22 deletions
+2 -1
View File
@@ -1,5 +1,6 @@
import type { INestApplication } from '@nestjs/common';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { readEnv } from '../../app-config';
import { attachZodBodySchemas } from '../common/api-zod';
/**
@@ -16,7 +17,7 @@ import { attachZodBodySchemas } from '../common/api-zod';
* accepts `Authorization: Bearer` everywhere as the cookie fallback.
*/
export function setupApiDocs(app: INestApplication): void {
const version: string = process.env.APP_VERSION || (require('../../../package.json') as { version: string }).version;
const version: string = readEnv().app.appVersion || (require('../../../package.json') as { version: string }).version;
const config = new DocumentBuilder()
.setTitle('TREK API')
.setDescription(