纠正:无论有没有用户配置,都要Object.assign(最基础配置,用户配置)
This commit is contained in:
10
server.js
10
server.js
@@ -1,9 +1,8 @@
|
||||
const fs = require('fs')
|
||||
const path = require('path')
|
||||
|
||||
const Config = require('so.base/Config.js')
|
||||
if (!Config || Object.keys(Config).length===0) {
|
||||
Config = { // 默认配置,如果用户什么也没有提供
|
||||
const Config = Object.assign({
|
||||
// 最基础的必须的默认配置,如果用户什么也没有提供
|
||||
protocol: 'http',
|
||||
host: 'localhost',
|
||||
from: './dist', // local path to serve as webroot
|
||||
@@ -13,8 +12,9 @@ if (!Config || Object.keys(Config).length===0) {
|
||||
{ webroot: 'dist', webindex: 'index.html', domainList: ['']}
|
||||
],
|
||||
*/
|
||||
}
|
||||
}
|
||||
},
|
||||
require('so.base/Config.js')
|
||||
)
|
||||
if (typeof(Config.ssl)==='string') {
|
||||
Config.ssl = eval(`(${Config.ssl})`)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user