| | |
| | | import { CoolConfig } from '@cool-midway/core'; |
| | | import { CoolCacheStore, CoolConfig } from '@cool-midway/core'; |
| | | import { MidwayConfig } from '@midwayjs/core'; |
| | | import { CoolCacheStore } from '@cool-midway/core'; |
| | | import * as path from 'path'; |
| | | import { pCachePath, pUploadPath } from '../comm/path'; |
| | | import { availablePort } from '../comm/port'; |
| | | |
| | | // redis缓存 |
| | | // import { redisStore } from 'cache-manager-ioredis-yet'; |
| | | |
| | | export default { |
| | | keys: 'f65bcafd-b72c-4f01-a451-333155097148', |
| | | // 确保每个项目唯一,项目首次启动会自动生成 |
| | | keys: '44ceca50-584c-44c4-8346-4b44471ea41f', |
| | | koa: { |
| | | port: availablePort(8001), |
| | | rawBody: true, |
| | | }, |
| | | // 开启异步上下文管理 |
| | | asyncContextManager: { |
| | | enable: true, |
| | | }, |
| | | // 静态文件配置 |
| | | staticFile: { |
| | | buffer: true, |
| | | dirs: { |
| | |
| | | }, |
| | | }, |
| | | }, |
| | | // 文件上传 |
| | | upload: { |
| | | fileSize: '200mb', |
| | | whitelist: null, |
| | | ignore: ['/open/push/yingshiyun', "/open/push/cameraEvent"], |
| | | }, |
| | | // 缓存 可切换成其他缓存如:redis http://www.midwayjs.org/docs/extensions/caching |
| | | cacheManager: { |
| | | clients: { |
| | | default: { |
| | |
| | | }, |
| | | }, |
| | | }, |
| | | // cacheManager: { |
| | | // clients: { |
| | | // default: { |
| | | // store: redisStore, |
| | | // options: { |
| | | // port: 6379, |
| | | // host: '127.0.0.1', |
| | | // password: '', |
| | | // ttl: 0, |
| | | // db: 0, |
| | | // }, |
| | | // }, |
| | | // }, |
| | | // }, |
| | | cool: { |
| | | redis: { |
| | | host: '127.0.0.1', |
| | | password: '', |
| | | port: 6379, |
| | | db: 10, |
| | | }, |
| | | // 已经插件化,本地文件上传查看 plugin/config.ts,其他云存储查看对应插件的使用 |
| | | file: {}, |
| | | // 是否开启多租户 |
| | | tenant: { |
| | | enable: true, |
| | | // 是否开启多租户 |
| | | enable: false, |
| | | // 需要过滤多租户的url, 支持通配符, 如/admin/**/* 表示admin模块下的所有接口都进行多租户过滤 |
| | | urls: [], |
| | | }, |
| | | // 国际化配置 |
| | | i18n: { |
| | | enable: true, |
| | | // 是否开启 |
| | | enable: false, |
| | | // 语言 |
| | | languages: ['zh-cn', 'zh-tw', 'en'], |
| | | }, |
| | | // crud配置 |
| | | crud: { |
| | | // 插入模式,save不会校验字段(允许传入不存在的字段),insert会校验字段 |
| | | upsert: 'save', |
| | | // 软删除 |
| | | softDelete: true, |
| | | }, |
| | | }, |
| | | } as CoolConfig, |
| | | } as MidwayConfig; |
| | | } as MidwayConfig; |