diff options
author | 2023-09-04 18:08:59 +0200 | |
---|---|---|
committer | 2023-09-04 20:33:55 +0200 | |
commit | 0e7c55f7ab8d496e81a3dbd53f14e0c46cb27fa6 (patch) | |
tree | 3df27544768e96ec8508452d07b9c20c30f374b0 /subprojects/frontend/config/detectDevModeOptions.ts | |
parent | refactor(frontend): graph visualizer performance (diff) | |
download | refinery-0e7c55f7ab8d496e81a3dbd53f14e0c46cb27fa6.tar.gz refinery-0e7c55f7ab8d496e81a3dbd53f14e0c46cb27fa6.tar.zst refinery-0e7c55f7ab8d496e81a3dbd53f14e0c46cb27fa6.zip |
refactor: server environemntal variables
* Prefix each variable with REFINERY_
* If not public host is specified, allow all origings and compute the WebSocket
address on the client from the origin.
Diffstat (limited to 'subprojects/frontend/config/detectDevModeOptions.ts')
-rw-r--r-- | subprojects/frontend/config/detectDevModeOptions.ts | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/subprojects/frontend/config/detectDevModeOptions.ts b/subprojects/frontend/config/detectDevModeOptions.ts index 665204dc..6052e047 100644 --- a/subprojects/frontend/config/detectDevModeOptions.ts +++ b/subprojects/frontend/config/detectDevModeOptions.ts | |||
@@ -30,8 +30,8 @@ function detectListenOptions( | |||
30 | fallbackHost: string, | 30 | fallbackHost: string, |
31 | fallbackPort: number, | 31 | fallbackPort: number, |
32 | ): ListenOptions { | 32 | ): ListenOptions { |
33 | const host = process.env[`${name}_HOST`] ?? fallbackHost; | 33 | const host = process.env[`REFINERY_${name}_HOST`] ?? fallbackHost; |
34 | const rawPort = process.env[`${name}_PORT`]; | 34 | const rawPort = process.env[`REFINERY_${name}_PORT`]; |
35 | const port = rawPort === undefined ? fallbackPort : parseInt(rawPort, 10); | 35 | const port = rawPort === undefined ? fallbackPort : parseInt(rawPort, 10); |
36 | const secure = port === 443; | 36 | const secure = port === 443; |
37 | return { host, port, secure }; | 37 | return { host, port, secure }; |