mirror of https://codeberg.org/pzp/pzp-hub.git
support specifying ports as env vars
This commit is contained in:
parent
e6bf56282d
commit
04a13fbe4b
15
lib/index.js
15
lib/index.js
|
@ -29,10 +29,13 @@ app.get('/invite', (req, reply) => {
|
|||
reply.view('invite.ejs')
|
||||
})
|
||||
|
||||
app.listen({ port: 3000 }, (err, address) => {
|
||||
if (err) {
|
||||
app.log.error(err)
|
||||
process.exit(1)
|
||||
app.listen(
|
||||
{ host: '0.0.0.0', port: process.env.HTTP_PORT ?? 3000 },
|
||||
(err, address) => {
|
||||
if (err) {
|
||||
app.log.error(err)
|
||||
process.exit(1)
|
||||
}
|
||||
startPeer()
|
||||
}
|
||||
startPeer()
|
||||
})
|
||||
)
|
||||
|
|
|
@ -25,7 +25,12 @@ module.exports = function startPeer() {
|
|||
connections: {
|
||||
incoming: {
|
||||
net: [
|
||||
{ scope: 'public', transform: 'shse', port: 8008, host: '0.0.0.0' },
|
||||
{
|
||||
scope: 'public',
|
||||
transform: 'shse',
|
||||
port: process.env.PPPPP_PORT ?? 8008,
|
||||
host: '0.0.0.0',
|
||||
},
|
||||
],
|
||||
},
|
||||
outgoing: {
|
||||
|
|
Loading…
Reference in New Issue