From 7fd4aef757855061ea8bd0b226799bc72d148457 Mon Sep 17 00:00:00 2001 From: snowgitea Date: Wed, 1 Jul 2026 17:45:02 +0800 Subject: [PATCH] chore: src/config/config.local.ts --- src/config/config.local.ts | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/config/config.local.ts diff --git a/src/config/config.local.ts b/src/config/config.local.ts new file mode 100644 index 0000000..70f9c6c --- /dev/null +++ b/src/config/config.local.ts @@ -0,0 +1,32 @@ +import { CoolConfig } from '@cool-midway/core'; +import { MidwayConfig } from '@midwayjs/core'; + +/** + * 本地开发 npm run dev 读取的配置文件 + */ +export default { + typeorm: { + dataSource: { + default: { + type: 'sqlite', + database: './cool.db', + // 自动建表 注意:线上部署的时候不要使用,有可能导致数据丢失 + synchronize: true, + // 打印日志 + logging: false, + // 实体路径 + entities: ['**/modules/*/entity'], + } as any, + }, + } as any, + cool: { + // 实体与路径,跟生成代码、前端请求、swagger文档相关 注意:线上不建议开启,以免暴露敏感信息 + eps: true, + // 是否自动导入模块数据库 + initDB: true, + // 判断是否初始化的方式 + initJudge: 'db', + // 是否自动导入模块菜单 + initMenu: true, + } as CoolConfig, +} as MidwayConfig;