chore: src/config/config.prod.ts

This commit is contained in:
2026-07-01 17:55:40 +08:00
parent cd920c1bf2
commit 4441634c90
+44
View File
@@ -0,0 +1,44 @@
import { CoolConfig } from '@cool-midway/core';
import { MidwayConfig } from '@midwayjs/core';
import { entities } from '../entities';
import { TenantSubscriber } from '../modules/base/db/tenant';
/**
* 本地开发 npm run prod 读取的配置文件
*/
export default {
typeorm: {
dataSource: {
default: {
type: 'mysql',
host: '127.0.0.1',
port: 3306,
username: 'root',
password: '123456',
database: 'cool',
// 自动建表 注意:线上部署的时候不要使用,有可能导致数据丢失
synchronize: false,
// 打印日志
logging: false,
// 字符集
charset: 'utf8mb4',
// 是否开启缓存
cache: true,
// 实体路径
entities,
// 订阅者
subscribers: [TenantSubscriber],
},
},
},
cool: {
// 实体与路径,跟生成代码、前端请求、swagger文档相关 注意:线上不建议开启,以免暴露敏感信息
eps: false,
// 是否自动导入模块数据库
initDB: false,
// 判断是否初始化的方式
initJudge: 'db',
// 是否自动导入模块菜单
initMenu: false,
} as CoolConfig,
} as MidwayConfig;