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')
})
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()
})
)

View File

@ -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: {