Added Swagger and TypeORM, added Hello World
This commit is contained in:
+16
-2
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user