From a5ed05b35d5a7e71727de7f68961a668460af430 Mon Sep 17 00:00:00 2001 From: yutent Date: Thu, 2 Nov 2023 17:11:59 +0800 Subject: [PATCH] Update Config --- Config.md | 45 ++++++--------------------------------------- 1 file changed, 6 insertions(+), 39 deletions(-) diff --git a/Config.md b/Config.md index cd34580..cb70ffe 100644 --- a/Config.md +++ b/Config.md @@ -1,48 +1,20 @@ +## 默认配置 + ```js { - db: {}, - session: { - 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 + // 动态路由模式, 即无论是访问路径是什么, 永远只会调用 \apps\index\index() + dynamic: false, port: 3000, env: process.env.NODE_ENV === ENV_PROD ? ENV_PROD : ENV_DEV, 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: { enabled: false, credentials: false, origin: [], // ['abc.com', 'a.foo.com'] maxAge: 14400 }, + regexp: { // 常用正则 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)