forked from openmobilityfoundation/mds-core
-
Notifications
You must be signed in to change notification settings - Fork 9
/
Copy pathconfigurePorts.ts
45 lines (43 loc) · 1.29 KB
/
configurePorts.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
import findPort from 'find-port-free-sync'
/**
* Configure random ports for each API/Service
*/
Object.assign(
process.env,
...[
'ACTIVITY_SERVICE_REPL_PORT',
'ACTIVITY_SERVICE_RPC_PORT',
'AGENCY_API_HTTP_PORT',
'ATTACHMENT_SERVICE_REPL_PORT',
'ATTACHMENT_SERVICE_RPC_PORT',
'AUDIT_API_HTTP_PORT',
'AUDIT_SERVICE_REPL_PORT',
'AUDIT_SERVICE_RPC_PORT',
'COLLECTOR_API_HTTP_PORT',
'COLLECTOR_SERVICE_REPL_PORT',
'COLLECTOR_SERVICE_RPC_PORT',
'COMPLIANCE_API_HTTP_PORT',
'COMPLIANCE_SERVICE_REPL_PORT',
'COMPLIANCE_SERVICE_RPC_PORT',
'CONFIG_API_HTTP_PORT',
'CONFIG_SERVICE_REPL_PORT',
'CONFIG_SERVICE_RPC_PORT',
'GEOGRAPHY_API_HTTP_PORT',
'GEOGRAPHY_AUTHOR_API_HTTP_PORT',
'GEOGRAPHY_SERVICE_REPL_PORT',
'GEOGRAPHY_SERVICE_RPC_PORT',
'INGEST_SERVICE_REPL_PORT',
'INGEST_SERVICE_RPC_PORT',
'JURISDICTION_API_HTTP_PORT',
'JURISDICTION_SERVICE_REPL_PORT',
'JURISDICTION_SERVICE_RPC_PORT',
'POLICY_API_HTTP_PORT',
'POLICY_AUTHOR_API_HTTP_PORT',
'POLICY_SERVICE_REPL_PORT',
'POLICY_SERVICE_RPC_PORT',
'RPC_PORT',
'TRANSACTION_API_HTTP_PORT',
'TRANSACTION_SERVICE_REPL_PORT',
'TRANSACTION_SERVICE_RPC_PORT'
].map(envvar => ({ [envvar]: `${findPort({ start: 4000, end: 6000 })}` }))
)