forked from Shared/esg
Compare commits
10 Commits
45ef396466
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 6e0870b2f1 | |||
| e474f2d52d | |||
| 5ace0165db | |||
| 9fa4144949 | |||
|
|
8af8c8d6df | ||
| 73966878a2 | |||
|
|
e7bb312db2 | ||
| 62c8c6a3b4 | |||
| 91f43c312f | |||
| 4a65f356df |
10
.env.example
10
.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
|
||||
|
||||
17
src/main.ts
17
src/main.ts
@@ -59,13 +59,28 @@ async function bootstrap(): Promise<void> {
|
||||
}),
|
||||
);
|
||||
|
||||
const swaggerConfig = new DocumentBuilder()
|
||||
const baseUrlProd = process.env.BASE_URL_PROD;
|
||||
const clientUrl = process.env.CLIENT_URL;
|
||||
|
||||
const documentBuilder = new DocumentBuilder()
|
||||
.setTitle('External Services Gateway')
|
||||
.setDescription(
|
||||
'Unified gateway for external inquiry providers with JWT authentication, RBAC, ' +
|
||||
'per-user inquiry access, audit logging, and normalized inquiry responses.',
|
||||
)
|
||||
.setVersion('1.0')
|
||||
.addServer("http://localhost:8085")
|
||||
.addServer("http://192.168.20.22:8085");
|
||||
|
||||
if (clientUrl) {
|
||||
documentBuilder.addServer(clientUrl);
|
||||
}
|
||||
|
||||
if (baseUrlProd) {
|
||||
documentBuilder.addServer(baseUrlProd);
|
||||
}
|
||||
|
||||
const swaggerConfig = documentBuilder
|
||||
.addBearerAuth(
|
||||
{ type: 'http', scheme: 'bearer', bearerFormat: 'JWT', in: 'header' },
|
||||
'bearer',
|
||||
|
||||
Reference in New Issue
Block a user