feat(server): switched DEEMIX_PORT to DEEMIX_SERVER_PORT, this closes #10 (breaking change)
This commit is contained in:
parent
74f654fa6e
commit
94755a47a9
4
index.js
4
index.js
@ -12,9 +12,9 @@ const argv = yargs(hideBin(process.argv)).options({
|
|||||||
}).argv
|
}).argv
|
||||||
const server = require('./server/dist/app.js')
|
const server = require('./server/dist/app.js')
|
||||||
|
|
||||||
const PORT = process.env.DEEMIX_PORT || argv.port
|
const PORT = process.env.DEEMIX_SERVER_PORT || argv.port
|
||||||
|
|
||||||
process.env.DEEMIX_PORT = PORT
|
process.env.DEEMIX_SERVER_PORT = PORT
|
||||||
process.env.DEEMIX_HOST = argv.host
|
process.env.DEEMIX_HOST = argv.host
|
||||||
|
|
||||||
let win
|
let win
|
||||||
|
2
server/dist/app.js
vendored
2
server/dist/app.js
vendored
File diff suppressed because one or more lines are too long
@ -24,7 +24,7 @@ const argv = yargs(hideBin(process.argv)).options({
|
|||||||
host: { type: 'string', default: '127.0.0.1' }
|
host: { type: 'string', default: '127.0.0.1' }
|
||||||
}).argv as Arguments
|
}).argv as Arguments
|
||||||
|
|
||||||
const DEEMIX_PORT = normalizePort(process.env.DEEMIX_PORT ?? argv.port)
|
const DEEMIX_SERVER_PORT = normalizePort(process.env.DEEMIX_SERVER_PORT ?? argv.port)
|
||||||
const DEEMIX_HOST = process.env.DEEMIX_HOST ?? argv.host
|
const DEEMIX_HOST = process.env.DEEMIX_HOST ?? argv.host
|
||||||
|
|
||||||
const debug = initDebug('deemix-gui:server')
|
const debug = initDebug('deemix-gui:server')
|
||||||
@ -42,11 +42,11 @@ app.use('/', indexRouter)
|
|||||||
registerApis(app)
|
registerApis(app)
|
||||||
|
|
||||||
/* === Config === */
|
/* === Config === */
|
||||||
app.set('port', DEEMIX_PORT)
|
app.set('port', DEEMIX_SERVER_PORT)
|
||||||
|
|
||||||
/* === Server port === */
|
/* === Server port === */
|
||||||
if (process.env.NODE_ENV !== 'test') {
|
if (process.env.NODE_ENV !== 'test') {
|
||||||
server.listen({ port: DEEMIX_PORT, host: DEEMIX_HOST })
|
server.listen({ port: DEEMIX_SERVER_PORT, host: DEEMIX_HOST })
|
||||||
}
|
}
|
||||||
|
|
||||||
registerWebsocket(wss)
|
registerWebsocket(wss)
|
||||||
@ -63,5 +63,5 @@ server.on('upgrade', (request, socket, head) => {
|
|||||||
wss.emit('connection', socket, request)
|
wss.emit('connection', socket, request)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
server.on('error', getErrorCb(DEEMIX_PORT))
|
server.on('error', getErrorCb(DEEMIX_SERVER_PORT))
|
||||||
server.on('listening', getListeningCb(server, debug))
|
server.on('listening', getListeningCb(server, debug))
|
||||||
|
Loading…
Reference in New Issue
Block a user