mirror of
https://github.com/danbulant/flying-squid
synced 2026-06-19 22:41:52 +00:00
Make default settings default (fix #223)
This commit is contained in:
parent
b6eca14b82
commit
7bd164aa39
1 changed files with 10 additions and 1 deletions
11
app.js
11
app.js
|
|
@ -2,12 +2,21 @@
|
|||
|
||||
const mcServer = require('./')
|
||||
|
||||
const defaultSettings = require('./config/default-settings')
|
||||
|
||||
let settings
|
||||
|
||||
try {
|
||||
settings = require('./config/settings')
|
||||
|
||||
Object.keys(defaultSettings).forEach(settingKey => {
|
||||
if(settings[settingKey] === undefined) {
|
||||
settings[settingKey] = defaultSettings[settingKey];
|
||||
}
|
||||
})
|
||||
|
||||
} catch (err) {
|
||||
settings = require('./config/default-settings')
|
||||
settings = defaultSettings
|
||||
}
|
||||
|
||||
module.exports = mcServer.createMCServer(settings)
|
||||
|
|
|
|||
Loading…
Reference in a new issue