1 | var path = require('path');
|
2 | var rootPath = path.dirname(require.main.filename);
|
3 |
|
4 |
|
5 | /*
|
6 |
|
7 | port: 服务器端口
|
8 | publicFloder: 静态文件夹目录
|
9 | views: 动态模板文件路径
|
10 | view engine: 动态模板引擎 默认hbs
|
11 | directroy:
|
12 | 参数
|
13 | true 开启静态文件夹管理器
|
14 | false 关闭静态文件夹管理器
|
15 | logger:
|
16 | 参数
|
17 | :method :url - :referrer ---> GET /index.html - http://localhost:8000/
|
18 | short ---> 127.0.0.1 - GET /index.html HTTP/1.1 304 - - 3 ms
|
19 | tiny ---> GET /index.html 304 - - 6 ms
|
20 | dev ---> GET /index.html 304 9ms 有颜色,便于观看
|
21 | default ---> 127.0.0.1 - - [Mon, 10 Feb 2014 17:56:59 GMT]
|
22 | "GET /index.html HTTP/1.1" 304 - "-" "Mozilla/5.0
|
23 | (iPhone; U; CPU iPhone OS 4_3_2 like Mac OS X; en-us)
|
24 | AppleWebKit/533.17.9 (KHTML, like Gecko) Version/5.0.2
|
25 | Mobile/8H7 Safari/6533.18.5"
|
26 | */
|
27 |
|
28 | var config = {
|
29 | general:{
|
30 | env:"default",
|
31 | /* 开发模式 development ,生产模式 production*/
|
32 | "viewsPath":'views', /*模板文件路径*/
|
33 | "view engine":'hbs',
|
34 | controllerPath:'controllers',
|
35 | publicFloder:"public",
|
36 | },
|
37 |
|
38 | /*开发模式配置*/
|
39 | default:{
|
40 | 'port':8000,
|
41 | /*在启动的时候也可以用 PORT=9000 node service.js */
|
42 | mongodb:"mongodb://localhost/test",
|
43 | logger:"dev",
|
44 | directory:false, /*静态文件管理器功能 参数 true , false*/
|
45 | },
|
46 |
|
47 |
|
48 | /*开发模式配置*/
|
49 | development:{
|
50 | 'port':8000,
|
51 | /*在启动的时候也可以用 PORT=9000 node service.js */
|
52 | mongodb:"mongodb://localhost/test",
|
53 | logger:"dev",
|
54 | directory:false, /*静态文件管理器功能 参数 true , false*/
|
55 | },
|
56 |
|
57 |
|
58 |
|
59 | /*生产模式配置*/
|
60 | production:{
|
61 | port:8000,
|
62 | /*在启动的时候也可以用 PORT=9000 node service.js */
|
63 | mongodb:"",
|
64 | directory:true
|
65 | }
|
66 | }
|
67 |
|
68 | module.exports = config; |
\ | No newline at end of file |