support specifying ports as env vars

This commit is contained in:
Andre Staltz 2024-01-04 13:33:04 +02:00
parent e6bf56282d
commit 04a13fbe4b
No known key found for this signature in database
GPG Key ID: 9EDE23EA7E8A4890
2 changed files with 15 additions and 7 deletions

View File

@ -29,10 +29,13 @@ app.get('/invite', (req, reply) => {
reply.view('invite.ejs') reply.view('invite.ejs')
}) })
app.listen({ port: 3000 }, (err, address) => { app.listen(
if (err) { { host: '0.0.0.0', port: process.env.HTTP_PORT ?? 3000 },
app.log.error(err) (err, address) => {
process.exit(1) if (err) {
app.log.error(err)
process.exit(1)
}
startPeer()
} }
startPeer() )
})

View File

@ -25,7 +25,12 @@ module.exports = function startPeer() {
connections: { connections: {
incoming: { incoming: {
net: [ 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: { outgoing: {