chore: switched all urls to relative paths

This commit is contained in:
Davide Passoni
2024-12-09 10:18:58 +01:00
parent a4452aee94
commit 96899121f7
15 changed files with 43 additions and 52 deletions

View File

@@ -19,7 +19,7 @@ import { MapOptionsChangedEvent, ServerStatusUpdatedEvent } from "../events";
export class ServerManager {
#connected: boolean = false;
#paused: boolean = false;
#REST_ADDRESS = "http://localhost:3001/olympus";
#REST_ADDRESS = "./olympus";
#username: null | string = null;
#password: null | string = null;
#sessionHash: string | null = null;
@@ -164,7 +164,7 @@ export class ServerManager {
getConfig(callback: CallableFunction) {
var xmlHttp = new XMLHttpRequest();
xmlHttp.open("GET", getApp().getExpressAddress() + "config", true);
xmlHttp.open("GET", "./config", true);
xmlHttp.onload = function (e) {
var data = JSON.parse(xmlHttp.responseText);
callback(data);
@@ -175,12 +175,6 @@ export class ServerManager {
xmlHttp.send(null);
}
setAddress(address: string) {
this.#REST_ADDRESS = address;
console.log(`Setting REST address to ${this.#REST_ADDRESS}`);
}
getAirbases(callback: CallableFunction, errorCallback: CallableFunction = () => {}) {
this.GET(callback, errorCallback, AIRBASES_URI);
}