refactor: 完成项目整体目录重构与路径别名配置
1. 重构项目文件结构,统一文件存放位置与命名规则 2. 配置tsconfig路径别名,替换原有相对路径导入 3. 迁移drama-status枚举到dramas.types统一管理 4. 新增全局配置文件与工具类,补充完整注释与文档 5. 修复所有导入路径与依赖引用问题
This commit is contained in:
21
src/main.ts
21
src/main.ts
@@ -1,13 +1,24 @@
|
||||
/**
|
||||
* App main.
|
||||
* @file Index 入口文件
|
||||
* @module src/main
|
||||
* @author zhxiao1124
|
||||
*/
|
||||
|
||||
import "dotenv/config";
|
||||
import { Logger } from "@nestjs/common";
|
||||
import { NestFactory } from "@nestjs/core";
|
||||
import { AppModule } from "./app.module";
|
||||
import { bootstrapApp } from "./bootstrap";
|
||||
import { APP_CONFIG, OPTIONS_CONFIG } from "@config/app.config";
|
||||
import { AppModule } from "@src/app/app.module";
|
||||
import { bootstrapApp } from "@src/bootstrap";
|
||||
|
||||
const logger = new Logger("AppLoader");
|
||||
|
||||
async function bootstrap() {
|
||||
const app = await NestFactory.create(AppModule);
|
||||
const app = await NestFactory.create(AppModule, OPTIONS_CONFIG);
|
||||
bootstrapApp(app);
|
||||
await app.listen(process.env.PORT ?? 3000);
|
||||
console.log(`Application is running on: ${await app.getUrl()}`);
|
||||
await app.listen(APP_CONFIG.PORT);
|
||||
logger.log(`Application is running on: ${await app.getUrl()}`);
|
||||
}
|
||||
|
||||
void bootstrap();
|
||||
|
||||
Reference in New Issue
Block a user