wangrong
10 天以前 c4d7079ac30b4ed0393c2dc831627825c7a545d6
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
import { 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';
 
export default {
  keys: 'f65bcafd-b72c-4f01-a451-333155097148',
  koa: {
    port: availablePort(8001),
    rawBody: true,    
  },
  asyncContextManager: {
    enable: true,
  },
  staticFile: {
    buffer: true,
    dirs: {
      default: {
        prefix: '/',
        dir: path.join(__dirname, '..', '..', 'public'),
      },
      static: {
        prefix: '/upload',
        dir: pUploadPath(),
      },
    },
  },
  upload: {
    fileSize: '200mb',
    whitelist: null,
    ignore: ['/open/push/yingshiyun', "/open/push/cameraEvent"],    
  },
  cacheManager: {
    clients: {
      default: {
        store: CoolCacheStore,
        options: {
          path: pCachePath(),
          ttl: 0,
        },
      },
    },
  },
  cool: {
    file: {},
    tenant: {
      enable: true,
      urls: [],
    },
    i18n: {
      enable: true,
      languages: ['zh-cn', 'zh-tw', 'en'],
    },
    crud: {
      upsert: 'save',
      softDelete: true,
    },  
  } as CoolConfig,
} as MidwayConfig;