mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-12-02 09:22:15 +00:00
refactor(server): bootstrap and middleware read config via app-config
This commit is contained in:
@@ -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(
|
||||
|
||||
Reference in New Issue
Block a user