-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathconfig.js
More file actions
executable file
·66 lines (66 loc) · 2.3 KB
/
config.js
File metadata and controls
executable file
·66 lines (66 loc) · 2.3 KB
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
62
63
64
65
66
// 设置应用程序根目录
const rootPath = __dirname;
/** 框架参数设置 */
exports.config = {
"name": "nvlbs framework",
"version": "0.0.1",
/** 是否自动加载数据库配置 */
"autoloadoption": true,
/** 框架根目录 */
"rootPath": rootPath,
/** 目录结构定义 */
"catalog": {
"upload": "public/resource/avatar/", // 上传文件存放目录
"request-handler": "lib/request-handlers", // request-handler 存放目录
"server-handler": "lib/server-handlers", // server-handler 存放目录
"controller": "lib/controllers", // controller 存放目录
"typeextend": "lib/extends", // typeextends 存放目录
"module": "lib/modules", // modules 存放目录
},
/** 中间件参数设置 */
"middleware": {
/** 文件操作中间件参数设置 */
"fsh": {
/** 扫描忽略的目录名称 */
"ignore": [
".git", ".svn", ".DS_Store"
]
},
/** 日志记录器中间件参数设置 */
"logger": {
"debug": true,
"info": true,
"warn": true,
"error": true,
"sql": true
}
},
/** 模块参数设置 */
"module": {
"app": {
"public": "public", // 公共目录,默认为public
"view": "views", // 视图目录,默认为views
"engine": "html", // 页面试图引擎,默认为html
/** Session 相关设置 */
"session": {
"secret": '12345',
//name: 'MYAPPNAME', //这里的name值得是cookie的name,默认cookie的name是:connect.sid
"cookie": { maxAge: 30 * 1000 * 60 }, //设置maxAge是80000ms,即80s后session和相应的cookie失效过期
"resave": false,
"saveUninitialized": true
}
}
},
/** 数据库参数设置 */
"database": {
"mysql": {
"connectionLimit": 30,
"host": "localhost",
"password": "123456",
"user": "root",
"database": "nodejs",
"waitForConnections": false,
"charset": "UTF8_GENERAL_CI"
}
},
}