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

Commit 08282dd

Browse files
vasco-santosjacobheun
andauthoredApr 2, 2020
feat: support dash case parameters (#211)
* feat: support dash case parameters * chore: apply suggestions from code review Co-Authored-By: Jacob Heun <jacobheun@gmail.com> Co-authored-by: Jacob Heun <jacobheun@gmail.com>
1 parent ce77e37 commit 08282dd

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed
 

‎src/sig-server/bin.js

+12-3
Original file line numberDiff line numberDiff line change
@@ -3,13 +3,22 @@
33

44
'use strict'
55

6+
// Usage: $0 [--host <host>] [--port <port>] [--disable-metrics]
7+
68
const signalling = require('./index')
7-
const argv = require('minimist')(process.argv.slice(2))
9+
const minimist = require('minimist')
10+
const argv = minimist(process.argv.slice(2), {
11+
alias: {
12+
p: 'port',
13+
h: 'host',
14+
'disable-metrics': 'disableMetrics'
15+
}
16+
})
817

918
;(async () => {
1019
const server = await signalling.start({
11-
port: argv.port || argv.p || process.env.PORT || 9090,
12-
host: argv.host || argv.h || process.env.HOST || '0.0.0.0',
20+
port: argv.port || process.env.PORT || 9090,
21+
host: argv.host || process.env.HOST || '0.0.0.0',
1322
metrics: !(argv.disableMetrics || process.env.DISABLE_METRICS)
1423
})
1524

0 commit comments

Comments
 (0)
This repository has been archived.