fix issues

This commit is contained in:
2025-12-31 21:29:56 +01:00
parent 16e0bdaec1
commit 02c0cc44e1
5 changed files with 43 additions and 12 deletions

View File

@@ -6,9 +6,6 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { writeFileSync } from 'fs';
import { join } from 'path';
import { AppModule } from './app.module';
import { AuthenticationGuard } from './domain/auth/AuthenticationGuard';
import { AuthorizationGuard } from './domain/auth/AuthorizationGuard';
import { FeatureAvailabilityGuard } from './domain/policy/FeatureAvailabilityGuard';
import { getGenerateOpenapi } from './env';
async function bootstrap() {
@@ -65,9 +62,8 @@ async function bootstrap() {
.addTag('analytics', 'Analytics and reporting endpoints')
.build();
// eslint-disable-next-line @typescript-eslint/no-explicit-any
const document = SwaggerModule.createDocument(app as any, config);
SwaggerModule.setup('api/docs', app as any, document);
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('api/docs', app, document);
// OpenAPI export
if (generateOpenapi) {
@@ -83,8 +79,8 @@ async function bootstrap() {
await app.listen(3000);
console.log('✅ API Server started successfully on port 3000');
console.log('📚 Swagger docs: http://localhost:3000/api/docs');
} catch (error: any) {
console.error('❌ Failed to start API server:', error.message);
} catch (error: unknown) {
console.error('❌ Failed to start API server:', error instanceof Error ? error.message : 'Unknown error');
process.exit(1);
}
}
@@ -95,8 +91,8 @@ process.on('uncaughtException', (error) => {
process.exit(1);
});
process.on('unhandledRejection', (reason: any) => {
console.error('🚨 Unhandled Rejection:', reason?.message || reason);
process.on('unhandledRejection', (reason: unknown) => {
console.error('🚨 Unhandled Rejection:', reason instanceof Error ? reason.message : reason);
process.exit(1);
});