feat(docs): add Swagger/OpenAPI endpoints for center and guild services
This commit is contained in:
@@ -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';
|
||||
|
||||
async function bootstrap() {
|
||||
@@ -13,6 +14,15 @@ async function bootstrap() {
|
||||
transform: true,
|
||||
}),
|
||||
);
|
||||
|
||||
const swaggerConfig = new DocumentBuilder()
|
||||
.setTitle('Fabric Backend Guild API')
|
||||
.setDescription('Guild Node 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) : 7002;
|
||||
await app.listen(port);
|
||||
console.log(`Fabric.Backend.Guild listening on :${port}`);
|
||||
|
||||
Reference in New Issue
Block a user