Added Swagger and TypeORM, added Hello World

This commit is contained in:
2026-01-29 20:42:07 +01:00
parent be19571e30
commit 1948ce58d3
7 changed files with 679 additions and 98 deletions
+16 -2
View File
@@ -1,9 +1,23 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { NestFastifyApplication, FastifyAdapter } from '@nestjs/platform-fastify';
import { FastifyContextConfig } from 'fastify';
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
async function bootstrap() {
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter());
await app.listen(process.env.PORT ?? 3000);
const app = await NestFactory.create<NestFastifyApplication>(AppModule, new FastifyAdapter({
listeningOrigin: "0.0.0.0"
} as FastifyContextConfig));
const config = new DocumentBuilder()
.setTitle('Ritzenbergen API')
.setDescription('The Ritzenbergen API description')
.setVersion('1.0')
.addTag('ritzenbergen')
.build();
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('/api/docs', app, document);
await app.listen(process.env.PORT ?? 3000, "0.0.0.0");
}
bootstrap();