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

5
.env
View file

@ -3,6 +3,7 @@
##################################
# Set the port for receiving connections
PUBLIC_IP=
PORT=3000
AUTH_PORT=8070
BILLING_PORT=8080
@ -16,7 +17,7 @@ ENABLE_HELMET=false
TZ=America/New_York
##################################
# LOGGING CONFIGURATION #
# LOGGING CONFIGURATION #
##################################
LOG_LEVEL=info
@ -27,7 +28,7 @@ LOG_ACCOUNT_CONSOLE=false
LOG_MAILER_CONSOLE=false
##################################
# API DATABASE CONFIGURATION #
# API DATABASE CONFIGURATION #
##################################
# Set a host to connect to the SQL server database.

View file

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