options fix.. remove redundant tests
This commit is contained in:
@ -95,9 +95,11 @@ class LocalWebServer {
|
||||
}
|
||||
|
||||
/* combine in stored config */
|
||||
options = Object.assign({ port: 8000 }, initOptions, stored, options.server, options.middleware, options.misc)
|
||||
options = Object.assign({ port: 8000 }, initOptions, stored || {}, options.server, options.middleware, options.misc)
|
||||
this.options = options
|
||||
|
||||
// console.log(initOptions, stored, options)
|
||||
|
||||
if (options.verbose) {
|
||||
// debug.setLevel(1)
|
||||
}
|
||||
@ -176,6 +178,7 @@ class LocalWebServer {
|
||||
listen () {
|
||||
const options = this.options
|
||||
const server = this._server = this.getServer()
|
||||
// console.log(options)
|
||||
return new Promise((resolve, reject) => {
|
||||
server.listen(options.port, () => {
|
||||
onServerUp(options.port, options['static.root'], server.isHttps)
|
||||
@ -254,7 +257,7 @@ function loadStack (modulePath) {
|
||||
}
|
||||
|
||||
function isModule (module) {
|
||||
return module.prototype.middleware || module.prototype.stack
|
||||
return module.prototype && (module.prototype.middleware || module.prototype.stack)
|
||||
}
|
||||
|
||||
module.exports = LocalWebServer
|
||||
|
Reference in New Issue
Block a user