...
|
...
|
@@ -22,11 +22,14 @@ const memcached = require('connect-memcached'); |
|
|
const hbs = require('express-handlebars');
|
|
|
const pkg = require('./package.json');
|
|
|
|
|
|
const yohoLib = require('yoho-node-lib');
|
|
|
|
|
|
const app = express();
|
|
|
const MemcachedStore = memcached(session);
|
|
|
|
|
|
// 指定libray目录
|
|
|
global.library = path.resolve('./library');
|
|
|
// 全局注册library
|
|
|
yohoLib.global(config);
|
|
|
|
|
|
global.middleware = path.resolve('./doraemon/middleware');
|
|
|
global.utils = path.resolve('./utils');
|
|
|
|
...
|
...
|
@@ -41,7 +44,7 @@ app.engine('.hbs', hbs({ |
|
|
defaultLayout: 'layout',
|
|
|
layoutsDir: './doraemon/views',
|
|
|
partialsDir: './doraemon/views/partial',
|
|
|
helpers: require(`${global.library}/helpers`)
|
|
|
helpers: global.yoho.helpers
|
|
|
}));
|
|
|
|
|
|
app.use(favicon(path.join(__dirname, '/public/favicon.ico')));
|
...
|
...
|
@@ -74,7 +77,7 @@ app.use((req, res, next) => { |
|
|
next();
|
|
|
});
|
|
|
|
|
|
const logger = require('./library/logger');
|
|
|
const logger = global.yoho.logger;
|
|
|
|
|
|
// dispatcher
|
|
|
try {
|
...
|
...
|
|