正在显示
1 个修改的文件
包含
24 行增加
和
20 行删除
@@ -71,11 +71,17 @@ exports = module.exports = function() { | @@ -71,11 +71,17 @@ exports = module.exports = function() { | ||
71 | } | 71 | } |
72 | }, | 72 | }, |
73 | development: { | 73 | development: { |
74 | - port: 3000, | 74 | + server: { |
75 | + port: 3000 | ||
76 | + } | ||
75 | }, | 77 | }, |
76 | production: { | 78 | production: { |
77 | - port: 3080, | ||
78 | - requests: false, | 79 | + server: { |
80 | + port: 3080 | ||
81 | + }, | ||
82 | + logger: { | ||
83 | + requests: false | ||
84 | + }, | ||
79 | output: { | 85 | output: { |
80 | colorize: false, | 86 | colorize: false, |
81 | prettyPrint: false | 87 | prettyPrint: false |
@@ -88,7 +94,7 @@ exports['@singleton'] = true | @@ -88,7 +94,7 @@ exports['@singleton'] = true | ||
88 | 94 | ||
89 | ``` | 95 | ``` |
90 | 96 | ||
91 | -You can have a `boot/local.js` with local settings if you need something unversioned (and load it by doing `$ export NODE_ENV=local`). | 97 | +You can have a `boot/local.js` with local settings if you need something unversioned (and load it when the environment is `development` — default). |
92 | 98 | ||
93 | ```js | 99 | ```js |
94 | // boot/local.js | 100 | // boot/local.js |
@@ -100,20 +106,18 @@ var maxAge = 30 * 24 * 60 * 60 * 1000 | @@ -100,20 +106,18 @@ var maxAge = 30 * 24 * 60 * 60 * 1000 | ||
100 | exports = module.exports = function() { | 106 | exports = module.exports = function() { |
101 | 107 | ||
102 | return { | 108 | return { |
103 | - local: { | ||
104 | - uploadsDir: uploadsDir, | ||
105 | - server: { | ||
106 | - host: '0.0.0.0', | ||
107 | - env: 'local', | ||
108 | - port: 3003, | ||
109 | - }, | ||
110 | - mongo: { | ||
111 | - dbname: 'igloo-local', | ||
112 | - }, | ||
113 | - redis: { | ||
114 | - prefix: 'igloo-local', | ||
115 | - maxAge: maxAge | ||
116 | - } | 109 | + uploadsDir: uploadsDir, |
110 | + server: { | ||
111 | + host: '0.0.0.0', | ||
112 | + env: 'local', | ||
113 | + port: 3003, | ||
114 | + }, | ||
115 | + mongo: { | ||
116 | + dbname: 'igloo-local', | ||
117 | + }, | ||
118 | + redis: { | ||
119 | + prefix: 'igloo-local', | ||
120 | + maxAge: maxAge | ||
117 | } | 121 | } |
118 | 122 | ||
119 | } | 123 | } |
@@ -156,8 +160,8 @@ app.get('/', function(req, res, next) { | @@ -156,8 +160,8 @@ app.get('/', function(req, res, next) { | ||
156 | res.send("It's cold outside, but warm in the igloo") | 160 | res.send("It's cold outside, but warm in the igloo") |
157 | }) | 161 | }) |
158 | 162 | ||
159 | -app.listen(settings.port, function() { | ||
160 | - logger.info('Server started on port %d', settings.port) | 163 | +app.listen(settings.server.port, function() { |
164 | + logger.info('Server started on port %d', settings.server.port) | ||
161 | }) | 165 | }) |
162 | 166 | ||
163 | ``` | 167 | ``` |
请
注册
或
登录
后发表评论