diff --git a/.env b/.env index 44c1ec3a5..4f6dc7cd1 100644 --- a/.env +++ b/.env @@ -14,4 +14,3 @@ ACCESS_TOKEN_SALT= ALPHA_VANTAGE_API_KEY= DATABASE_URL=postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@localhost:5432/${POSTGRES_DB}?sslmode=prefer JWT_SECRET_KEY= -PORT=3333 diff --git a/CHANGELOG.md b/CHANGELOG.md index 3336b81b3..34a18190a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -13,6 +13,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Changed +- Exposed the environment variable `HOST` - Decreased the number of attempts of queue jobs from `20` to `10` (fail earlier) - Improved the message for data provider errors in the client - Changed the label from _Balance_ to _Cash Balance_ in the account dialog diff --git a/apps/api/src/main.ts b/apps/api/src/main.ts index cf565a36d..546cbbf36 100644 --- a/apps/api/src/main.ts +++ b/apps/api/src/main.ts @@ -20,10 +20,11 @@ async function bootstrap() { }) ); + const host = process.env.HOST || 'localhost'; const port = process.env.PORT || 3333; - await app.listen(port, () => { + await app.listen(port, host, () => { logLogo(); - Logger.log(`Listening at http://localhost:${port}`); + Logger.log(`Listening at http://${host}:${port}`); Logger.log(''); }); } diff --git a/apps/api/src/services/configuration.service.ts b/apps/api/src/services/configuration.service.ts index 525951a70..cc80c1466 100644 --- a/apps/api/src/services/configuration.service.ts +++ b/apps/api/src/services/configuration.service.ts @@ -31,12 +31,13 @@ export class ConfigurationService { GOOGLE_SHEETS_ACCOUNT: str({ default: '' }), GOOGLE_SHEETS_ID: str({ default: '' }), GOOGLE_SHEETS_PRIVATE_KEY: str({ default: '' }), + HOST: host({ default: 'localhost' }), JWT_SECRET_KEY: str({}), MAX_ITEM_IN_CACHE: num({ default: 9999 }), MAX_ORDERS_TO_IMPORT: num({ default: Number.MAX_SAFE_INTEGER }), PORT: port({ default: 3333 }), RAKUTEN_RAPID_API_KEY: str({ default: '' }), - REDIS_HOST: str({ default: 'localhost' }), + REDIS_HOST: host({ default: 'localhost' }), REDIS_PASSWORD: str({ default: '' }), REDIS_PORT: port({ default: 6379 }), ROOT_URL: str({ default: 'http://localhost:4200' }),