Authored by ccbikai

模板中注入版本

Showing 1 changed file with 3 additions and 1 deletions
... ... @@ -9,7 +9,8 @@ let express = require('express'),
path = require('path'),
bodyParser = require('body-parser'),
cookieParser = require('cookie-parser'),
favicon = require('serve-favicon');
favicon = require('serve-favicon'),
pkg = require('./package.json');
require('express-handlebars');
... ... @@ -18,6 +19,7 @@ let app = express();
// 向模板注入变量
app.locals.devEnv = app.get('env') === 'development';
app.locals.version = pkg.version;
app.set('view engine', '.hbs');
... ...