initial commit
This commit is contained in:
commit
0024f44c80
34 changed files with 1991 additions and 0 deletions
32
backend/bin.mjs
Executable file
32
backend/bin.mjs
Executable file
|
|
@ -0,0 +1,32 @@
|
|||
import minimist from 'minimist'
|
||||
import { run } from './server.mjs'
|
||||
import createDebug from 'debug'
|
||||
|
||||
const debug = createDebug('streamer')
|
||||
|
||||
main().catch(onerror)
|
||||
|
||||
async function main () {
|
||||
const args = minimist(process.argv.slice(2), {
|
||||
default: {
|
||||
port: 3030,
|
||||
host: '0.0.0.0',
|
||||
input: 'alsa:default',
|
||||
output: 'alsa:default'
|
||||
},
|
||||
alias: {
|
||||
p: 'port',
|
||||
h: 'host',
|
||||
i: 'input',
|
||||
o: 'output'
|
||||
}
|
||||
})
|
||||
|
||||
await run(args)
|
||||
}
|
||||
|
||||
function onerror (err) {
|
||||
if (err) console.error(err instanceof Error ? err.message : String(err))
|
||||
debug(err)
|
||||
process.exit(1)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue