Skip to content
This repository has been archived by the owner on Apr 24, 2023. It is now read-only.

Commit

Permalink
feat: support dash case parameters (#211)
Browse files Browse the repository at this point in the history
* feat: support dash case parameters

* chore: apply suggestions from code review

Co-Authored-By: Jacob Heun <[email protected]>

Co-authored-by: Jacob Heun <[email protected]>
  • Loading branch information
vasco-santos and jacobheun authored Apr 2, 2020
1 parent ce77e37 commit 08282dd
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/sig-server/bin.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,22 @@

'use strict'

// Usage: $0 [--host <host>] [--port <port>] [--disable-metrics]

const signalling = require('./index')
const argv = require('minimist')(process.argv.slice(2))
const minimist = require('minimist')
const argv = minimist(process.argv.slice(2), {
alias: {
p: 'port',
h: 'host',
'disable-metrics': 'disableMetrics'
}
})

;(async () => {
const server = await signalling.start({
port: argv.port || argv.p || process.env.PORT || 9090,
host: argv.host || argv.h || process.env.HOST || '0.0.0.0',
port: argv.port || process.env.PORT || 9090,
host: argv.host || process.env.HOST || '0.0.0.0',
metrics: !(argv.disableMetrics || process.env.DISABLE_METRICS)
})

Expand Down

0 comments on commit 08282dd

Please sign in to comment.