Add PUBLIC_IP env variable

This commit is contained in:
Junior 2023-05-25 20:46:21 -03:00
parent 3ad8cc3fe0
commit 77ac4066d9
2 changed files with 8 additions and 6 deletions

1
.env
View file

@ -3,6 +3,7 @@
################################## ##################################
# Set the port for receiving connections # Set the port for receiving connections
PUBLIC_IP=
PORT=3000 PORT=3000
AUTH_PORT=8070 AUTH_PORT=8070
BILLING_PORT=8080 BILLING_PORT=8080

View file

@ -94,8 +94,9 @@ app.use((err, req, res, next) => {
// Start server // Start server
const port = process.env.PORT || 3000; const port = process.env.PORT || 3000;
app.listen(port, '0.0.0.0', () => { const publicIP = process.env.PUBLIC_IP || '0.0.0.0';
logger.info(`API listening on *:${port}`); app.listen(port, publicIP, () => {
logger.info(`Auth API listening on 127.0.0.1:${authPort}`); logger.info(`API listening on ${publicIP}:${port}`);
logger.info(`Billing API listening on 127.0.0.1:${billingPort}`); logger.info(`Auth API listening on ${publicIP}:${authPort}`);
logger.info(`Billing API listening on ${publicIP}:${billingPort}`);
}); });