added server config from env

This commit is contained in:
2026-07-18 10:17:52 +03:30
parent 9fa4144949
commit e474f2d52d
2 changed files with 16 additions and 1 deletions

View File

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

View File

@@ -60,6 +60,7 @@ async function bootstrap(): Promise<void> {
);
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<void> {
)
.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);