refactor: 统一代码缩进与引号风格,新增CORS配置
1. 修正所有文件的缩进为4空格,将单引号统一改为双引号 2. 新增CORS_ORIGIN环境变量配置并从env读取CORS允许源 3. 新增prettier配置文件统一代码格式 4. 为main.ts添加启动日志输出
This commit is contained in:
15
src/main.ts
15
src/main.ts
@@ -1,12 +1,13 @@
|
||||
import 'dotenv/config';
|
||||
import { NestFactory } from '@nestjs/core';
|
||||
import { AppModule } from './app.module';
|
||||
import { bootstrapApp } from './bootstrap';
|
||||
import "dotenv/config";
|
||||
import { NestFactory } from "@nestjs/core";
|
||||
import { AppModule } from "./app.module";
|
||||
import { bootstrapApp } from "./bootstrap";
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
bootstrapApp(app);
|
||||
await app.listen(process.env.PORT ?? 3000);
|
||||
const app = await NestFactory.create(AppModule);
|
||||
bootstrapApp(app);
|
||||
await app.listen(process.env.PORT ?? 3000);
|
||||
console.log(`Application is running on: ${await app.getUrl()}`);
|
||||
}
|
||||
|
||||
void bootstrap();
|
||||
|
||||
Reference in New Issue
Block a user