chore:清理空的gitkeep文件和临时文件

- 删除不再需要的.gitkeep占位文件
- 清理开发过程中的临时测试文件
This commit is contained in:
moyin
2025-12-17 11:03:40 +08:00
parent 418ecaa303
commit 8591f23505
6 changed files with 110 additions and 2 deletions

View File

View File

View File

@@ -1,8 +1,17 @@
import { NestFactory } from '@nestjs/core';
import { AppModule } from './app.module';
import { ValidationPipe } from '@nestjs/common';
async function bootstrap() {
const app = await NestFactory.create(AppModule);
// 全局启用校验管道(核心配置)
app.useGlobalPipes(
new ValidationPipe({
whitelist: true, // 过滤掉 DTO 中未定义的字段(比如传了个 `age` 但 DTO 里没有,会自动忽略)
forbidNonWhitelisted: true, // 若传了未定义的字段,直接报错(防止传多余参数)
transform: true, // 自动把入参转为 DTO 对应的类型(比如前端传的字符串数字 `'1'` 转为数字 `1`
}),
);
await app.listen(3000);
console.log('Pixel Game Server is running on http://localhost:3000');
}