Skip to content
Snippets Groups Projects
Commit 1bea4045 authored by Paolo.Brasolin's avatar Paolo.Brasolin
Browse files

feat: #fe consistently handle backend URLs

parent 1306afe7
No related branches found
No related tags found
No related merge requests found
Pipeline #23363 passed with warnings
......@@ -5,6 +5,11 @@ import "popper.js";
import "bootstrap";
import * as bootbox from "bootbox";
import "../css/override.css";
import path from "path";
const BACKEND_URL = new URL(process.env.BACKEND_URL);
const backendEndpointURL = (endpoint) =>
new URL(path.join(BACKEND_URL.pathname, endpoint), BACKEND_URL);
let config = {
type: Phaser.AUTO,
......@@ -86,8 +91,6 @@ function preload() {
});
}
window.OetziWordsSiteUrlPrefix = process.env.BACKEND_URL;
let gameRunning = false;
let player;
let scene;
......@@ -218,7 +221,7 @@ function dispatchEnemy() {
let e = new enemy();
axios
.post(window.OetziWordsSiteUrlPrefix + "GetImage", {
.post(backendEndpointURL("GetImage"), {
sessionImages: imageInUse,
})
.then(function (response) {
......@@ -310,7 +313,7 @@ class enemy {
}
axios
.post(window.OetziWordsSiteUrlPrefix + "CheckTranscription", {
.post(backendEndpointURL("CheckTranscription"), {
refData: me.refData,
transcription: result,
deltaTime: deltaTime,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment