1 | 'use strict'
|
2 |
|
3 |
|
4 |
|
5 |
|
6 |
|
7 |
|
8 |
|
9 | const useIfDefined = (value, fallback) => {
|
10 | if (typeof value === 'undefined') {
|
11 | return fallback
|
12 | } else {
|
13 | return value === 'true'
|
14 | }
|
15 | }
|
16 |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 |
|
22 |
|
23 | module.exports = {
|
24 | transporters: {
|
25 | axon: {
|
26 | enabled: useIfDefined(process.env.AGENT_TRANSPORT_AXON, true),
|
27 | endpoints: {
|
28 | push: process.env.AGENT_PUSH_ENDPOINT || 'push',
|
29 | pull: process.env.AGENT_REVERSE_ENDPOINT || 'reverse'
|
30 | }
|
31 | },
|
32 | websocket: {
|
33 | enabled: useIfDefined(process.env.AGENT_TRANSPORT_WEBSOCKET, false),
|
34 | endpoints: process.env.AGENT_WEBSOCKET_ENDPOINT || 'ws'
|
35 | }
|
36 | }
|
37 | }
|