-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.default.ts
53 lines (44 loc) · 1.12 KB
/
config.default.ts
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
import { EggAppConfig, EggAppInfo, PowerPartial } from 'egg';
import * as path from 'path';
export default (appInfo: EggAppInfo) => {
const config = {} as PowerPartial<EggAppConfig>;
config.view = {
root: [
path.join(appInfo.baseDir, 'app/view'),
path.join(__dirname, '../app/view'),
].join(','),
cache: true,
mapping: {
'.html': 'nunjucks',
},
defaultViewEngine: 'nunjucks',
defaultExtension: '.html',
};
config.nunjucks = {
tags: {
variableStart: '{$',
variableEnd: '$}',
}
}
config.static = {
dir: [
path.resolve(appInfo.baseDir, 'app/public'),
path.resolve(__dirname, '../app/public'),
],
};
config.token_key = 'C8DEE42E06244F1E';
config.adminPassports = ['adminDefault'];
config.adminAuth = ['default']; // service.admin.auth[]
config.helmetOptions = {
contentSecurityPolicy: {
useDefaults: true,
directives: {
'script-src': [ "'self'", "'unsafe-eval'", "'unsafe-inline'"],
'style-src': [ "'self'", "'unsafe-eval'", "'unsafe-inline'"],
},
},
};
return {
...config,
};
};