Update Config

master
yutent 2023-11-02 17:11:59 +08:00
parent 71ff5c4de9
commit a5ed05b35d
1 changed files with 6 additions and 39 deletions

@ -1,48 +1,20 @@
## 默认配置
```js ```js
{ {
db: {}, // 动态路由模式, 即无论是访问路径是什么, 永远只会调用 \apps\index\index()
session: { dynamic: false,
enabled: false,
type: 'native', // native 或 redis
ttl: 3600 * 24 * 7,
domain: '', // NODESSID域, 默认等于domain
level: 0, // 校验级别, 0: 不校验客户端, 2: ua, 4: ip, 6: ua + ip
db: {
host: '127.0.0.1',
port: 6379,
db: 0
}
},
jwt: {
// jwt 开关
enabled: false,
ttl: 3600 * 24 * 7,
level: 0, // 校验级别, 0: 不校验客户端, 2: ua, 4: ip, 6: ua + ip
secret: 'it_is_secret_key' // jwt密钥, 使用时请修改
},
website: 'localhost',
domain: '', // cookie域, 默认等于website
port: 3000, port: 3000,
env: process.env.NODE_ENV === ENV_PROD ? ENV_PROD : ENV_DEV, env: process.env.NODE_ENV === ENV_PROD ? ENV_PROD : ENV_DEV,
debug: process.env.NODE_ENV === ENV_DEV, // debug模式 debug: process.env.NODE_ENV === ENV_DEV, // debug模式
smtp: {
host: 'smtp.example.com',
port: 25,
mail: 'no-reply@example.com',
name: 'no-reply',
passwd: ''
},
views: {
enabled: false,
dir: '',
ext: '.htm'
},
cors: { cors: {
enabled: false, enabled: false,
credentials: false, credentials: false,
origin: [], // ['abc.com', 'a.foo.com'] origin: [], // ['abc.com', 'a.foo.com']
maxAge: 14400 maxAge: 14400
}, },
regexp: { regexp: {
// 常用正则 // 常用正则
email: /^[\w\.\-]+@\w+([\.\-]\w+)*\.\w+$/, email: /^[\w\.\-]+@\w+([\.\-]\w+)*\.\w+$/,
@ -58,9 +30,4 @@
----
上一节: [⟪入口文件配置⟫](https://github.com/bytedo/gmf.core/wiki/Entry)
下一节: [⟪路由⟫](https://github.com/bytedo/gmf.core/wiki/Router)