Skip to content

Commit 364699d

Browse files
committed
Standardize import statements and improve code formatting in main.ts: Updated import syntax to use double quotes for consistency, adjusted the formatting of the ValidationPipe configuration, and simplified the bootstrap function call for better readability.
1 parent 200088e commit 364699d

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

apps/api/src/main.ts

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
1-
import 'dotenv/config';
2-
import { NestFactory } from '@nestjs/core';
3-
import { AppModule } from './app.module';
4-
import { SwaggerModule, DocumentBuilder } from '@nestjs/swagger';
5-
import { INestApplication, ValidationPipe } from '@nestjs/common';
6-
import { generateOpenApiSpecs } from './utils/openapi';
7-
import chalk from 'chalk';
8-
import { NestExpressApplication } from '@nestjs/platform-express';
9-
import { AppConfig } from './common/config/app.config';
10-
import { apiReference } from '@scalar/nestjs-api-reference';
1+
import "dotenv/config";
2+
import { NestFactory } from "@nestjs/core";
3+
import { AppModule } from "./app.module";
4+
import { SwaggerModule, DocumentBuilder } from "@nestjs/swagger";
5+
import { INestApplication, ValidationPipe } from "@nestjs/common";
6+
import { generateOpenApiSpecs } from "./utils/openapi";
7+
import chalk from "chalk";
8+
import { NestExpressApplication } from "@nestjs/platform-express";
9+
import { AppConfig } from "./common/config/app.config";
10+
import { apiReference } from "@scalar/nestjs-api-reference";
1111

1212
async function bootstrap() {
1313
const app = await NestFactory.create<NestExpressApplication>(AppModule);
@@ -20,8 +20,8 @@ async function bootstrap() {
2020
app.useGlobalPipes(
2121
new ValidationPipe({
2222
whitelist: true,
23-
transform: true,
24-
}),
23+
transform: true
24+
})
2525
);
2626

2727
/* -------------------------------------------------------------------------- */
@@ -40,28 +40,28 @@ async function bootstrap() {
4040
});
4141
}
4242

43-
void bootstrap();
43+
bootstrap();
4444

4545
function setupSwagger(app: INestApplication) {
4646
const { name } = app.get(AppConfig);
4747

4848
const config = new DocumentBuilder()
4949
.setTitle(`${name} API`)
5050
.setDescription(`The ${name} API`)
51-
.setVersion('1.0')
51+
.setVersion("1.0")
5252
.addTag(name)
5353
.build();
5454

5555
const document = SwaggerModule.createDocument(app, config);
5656

5757
app.use(
58-
'/openapi',
58+
"/openapi",
5959
apiReference({
6060
sources: [
6161
{ content: document, title: `${name} API` },
62-
{ url: '/auth/client/open-api/generate-schema', title: 'BetterAuth' },
63-
],
64-
}),
62+
{ url: "/auth/client/open-api/generate-schema", title: "BetterAuth" }
63+
]
64+
})
6565
);
6666

6767
return document;

0 commit comments

Comments
 (0)