feat: auth guard 增加

This commit is contained in:
ilhamtahir committed 2024-11-16 20:01:04 +08:00
1 parent 346742b157
commit a2ee53f83a
11 files changed
+245 -6

No files matched your search

+5 -4
View File
@@ -5,6 +5,10 @@ import { DocumentBuilder, SwaggerModule } from '@nestjs/swagger';
import { ValidationPipe } from '@nestjs/common';
async function bootstrap() {
SnowflakeUtil.initialize(
parseInt(process.env.WORKER_ID, 10),
parseInt(process.env.DATACENTER_ID, 10),
);
const app = await NestFactory.create(AppModule);
if (['development', 'test'].includes(process.env.NODE_ENV)) {
const config = new DocumentBuilder()
@@ -15,10 +19,7 @@ async function bootstrap() {
const document = SwaggerModule.createDocument(app, config);
SwaggerModule.setup('docs', app, document);
}
SnowflakeUtil.initialize(
parseInt(process.env.WORKER_ID, 10),
parseInt(process.env.DATACENTER_ID, 10),
);
app.useGlobalPipes(
new ValidationPipe({
transform: true,