|
|
@ -21,10 +21,22 @@ module.exports = (neutrino, options = {}) => { |
|
|
|
const config = neutrino.config; |
|
|
|
const server = ramda.pathOr({}, ['options', 'server'], neutrino); |
|
|
|
const protocol = process.env.HTTPS ? 'https' : 'http'; |
|
|
|
const host = process.env.HOST || server.host || options.host || '0.0.0.0'; |
|
|
|
const publicHost = process.env.HOST; |
|
|
|
const port = process.env.PORT || server.port || options.port || 5000; |
|
|
|
const https = (protocol === 'https') || server.https || options.https; |
|
|
|
let openInBrowser = false; |
|
|
|
let serverPublic = false; |
|
|
|
let host = 'localhost'; |
|
|
|
|
|
|
|
if (server.public !== undefined) { |
|
|
|
serverPublic = Boolean(server.public); |
|
|
|
} else if (options.public !== undefined) { |
|
|
|
serverPublic = Boolean(options.public); |
|
|
|
} |
|
|
|
|
|
|
|
if (serverPublic) { |
|
|
|
host = '0.0.0.0'; |
|
|
|
} |
|
|
|
|
|
|
|
if (server.open !== undefined) { |
|
|
|
openInBrowser = Boolean(server.open); |
|
|
@ -39,7 +51,8 @@ module.exports = (neutrino, options = {}) => { |
|
|
|
.contentBase(neutrino.options.source) |
|
|
|
.historyApiFallback(true) |
|
|
|
.hot(true) |
|
|
|
.headers({ host }) |
|
|
|
.headers({ host: publicHost }) |
|
|
|
.public(publicHost) |
|
|
|
.publicPath('/') |
|
|
|
.stats({ |
|
|
|
assets: false, |
|
|
|