-
Notifications
You must be signed in to change notification settings - Fork 10
Expand file tree
/
Copy pathapp.js
More file actions
40 lines (25 loc) · 759 Bytes
/
app.js
File metadata and controls
40 lines (25 loc) · 759 Bytes
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
/**
* Created by nandy007 on 2017/02/08.
*/
/**
* Module dependencies.
*/
const http = require('http')
, path = require('path');
const appConfig = require('./config/config');
appConfig.common.projectPath = appConfig.projectPath || '';
global.rootPath = __dirname;
global.config = appConfig.common;
global.categoryCache = {};
const app = require('chestnut-app');
const router = require('chestnut-router');
const filters = require('./filters/router.filter');
router.addFilters(filters);
// 定义自己的static目录,默认的公共的static仍然在外层生效
if (process.env.NODE_ENV !== 'production') {
app.start(appConfig);
} else {
app.startCluster(appConfig);
}
require('./utils/gitdata').init();
module.exports = app;