feat(docs): add Swagger/OpenAPI endpoints for center and guild services

This commit is contained in:
nav
2026-05-12 11:41:30 +00:00
parent b014767324
commit 0731778bd3
7 changed files with 237 additions and 1 deletions

View File

@@ -1,6 +1,7 @@
import 'reflect-metadata';
import { ValidationPipe } from '@nestjs/common';
import { NestFactory } from '@nestjs/core';
import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { AppModule } from './app.module';
function requireEnv(name: string): string {
@@ -34,6 +35,15 @@ async function bootstrap() {
transform: true,
}),
);
const swaggerConfig = new DocumentBuilder()
.setTitle('Fabric Backend Center API')
.setDescription('Identity Hub APIs for Fabric')
.setVersion('1.0.0')
.build();
const swaggerDoc = SwaggerModule.createDocument(app, swaggerConfig);
SwaggerModule.setup('docs', app, swaggerDoc);
const port = process.env.PORT ? Number(process.env.PORT) : 7001;
await app.listen(port);
console.log(`Fabric.Backend.Center listening on :${port}`);