Skip to content

Commit

Permalink
add initdata env variable
Browse files Browse the repository at this point in the history
  • Loading branch information
jackhutu committed Oct 11, 2016
1 parent 277904e commit 53e8e3d
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Expand Up @@ -86,6 +86,7 @@ WEIBO_CALLBACK_URL
QQ_CLIENT_ID
QQ_CLIENT_SECRET
QQ_CALLBACK_URL
INITDATA
```

## 测试
Expand Down
2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "jackblog-api-koa",
"version": "1.1.8",
"version": "1.1.9",
"description": "jackblog API koa版",
"main": "server/app.js",
"scripts": {
Expand Down
2 changes: 1 addition & 1 deletion server/app.js
Expand Up @@ -23,7 +23,7 @@ mongoose.Promise = require('bluebird');
//mongoose.Promise = global.Promise;

// 初始化数据
if(config.seedDB && config.env === 'development') {
if(config.seedDB) {
const initData = require('./config/seed');
initData();
}
Expand Down
2 changes: 1 addition & 1 deletion server/config/env/index.js
Expand Up @@ -22,7 +22,7 @@ var all = {
password: process.env.REDIS_PASSWORD || ''
},
//是否初始化数据
seedDB: false,
seedDB: process.env.INITDATA || false,
session:{
secrets: 'jackblog-secret',
},
Expand Down

0 comments on commit 53e8e3d

Please sign in to comment.