mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Enable configuration of the server bind address.
A serverconfig.env (or just environment variables) can be set to override the default bind address/port for the backend. This is passed to the front end as a query parameter.
This commit is contained in:
@@ -1,11 +1,15 @@
|
||||
import axios from "axios";
|
||||
|
||||
export const HTTP_URL = "http://[::1]:1688/";
|
||||
const backendAddr =
|
||||
new URL(window.location.toString()).searchParams.get("server") ??
|
||||
"[::1]:1688";
|
||||
|
||||
export const HTTP_URL = `http://${backendAddr}/`;
|
||||
|
||||
export const backend = axios.create({
|
||||
baseURL: HTTP_URL,
|
||||
});
|
||||
|
||||
export const WEBSOCKET_URL = "ws://[::1]:1688/eventstream";
|
||||
export const WEBSOCKET_URL = `ws://${backendAddr}/eventstream`;
|
||||
|
||||
export default backend;
|
||||
|
||||
Reference in New Issue
Block a user