From e474f2d52d281b53ef9eb43b7ea6e542d8263e61 Mon Sep 17 00:00:00 2001 From: "s.hajizadeh" Date: Sat, 18 Jul 2026 10:17:52 +0330 Subject: [PATCH] added server config from env --- .env.example | 10 ++++++++++ src/main.ts | 7 ++++++- 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/.env.example b/.env.example index c2b2f0d..25c05c7 100644 --- a/.env.example +++ b/.env.example @@ -1,6 +1,9 @@ # Application PORT=8085 NODE_ENV=development +ESG_SMOKE_ENABLED=false +CLIENT_URL=https://apex.mic.co.ir/esg +BASE_URL_PROD= # MongoDB MONGODB_URI=mongodb://localhost:27017/inquiry-gateway @@ -18,6 +21,13 @@ BCRYPT_SALT_ROUNDS=12 THROTTLE_TTL=60 THROTTLE_LIMIT=100 +# Route outbound provider API calls through an SSH tunnel (Termius dynamic/SOCKS forward) +# Use socks5h so DNS resolves on the remote server. Leave empty for direct access. +OUTBOUND_PROXY=socks5h://127.0.0.1:6565 + +# Log every outbound provider HTTP call (request URL, status, response body preview) +OUTBOUND_HTTP_DEBUG=true + # Provider routing (per inquiry type) PERSON_DEFAULT_PROVIDER=PARSIAN PERSON_FALLBACK_ENABLED=true diff --git a/src/main.ts b/src/main.ts index d57a41a..c626627 100644 --- a/src/main.ts +++ b/src/main.ts @@ -60,6 +60,7 @@ async function bootstrap(): Promise { ); const baseUrlProd = process.env.BASE_URL_PROD; + const clientUrl = process.env.CLIENT_URL; const documentBuilder = new DocumentBuilder() .setTitle('External Services Gateway') @@ -69,7 +70,11 @@ async function bootstrap(): Promise { ) .setVersion('1.0') .addServer("http://localhost:8085") - .addServer("https://apex.mic.co.ir/esg/api"); + .addServer("http://192.168.20.22:8085"); + + if (clientUrl) { + documentBuilder.addServer(clientUrl); + } if (baseUrlProd) { documentBuilder.addServer(baseUrlProd);