Added ability to preview on proxy

This commit is contained in:
Davide Passoni 2024-06-28 11:25:30 +02:00
parent e07bf98e62
commit 36478f26d5
6 changed files with 7 additions and 12 deletions

View File

@ -158,8 +158,7 @@ export class OlympusApp {
this.#weaponsManager = new WeaponsManager();
/* Set the address of the server */
// Temporary forcing port 3000 for development
this.getServerManager().setAddress(window.location.href.split('?')[0].replace('8080', '3000'));
this.getServerManager().setAddress(window.location.href.split('?')[0]);
/* Setup all global events */
this.#setupEvents();
@ -182,8 +181,7 @@ export class OlympusApp {
})
/* Load the config file from the server */
// Temporary forcing port 3000 for development
const configRequest = new Request(window.location.href.split('?')[0].replace('8080', '3000') + "resources/config");
const configRequest = new Request(window.location.href.split('?')[0] + "resources/config");
fetch(configRequest).then((response) => {
if (response.status === 200) {
return response.json();

View File

@ -4,8 +4,7 @@ import { UnitDatabase } from "./unitdatabase"
export class AircraftDatabase extends UnitDatabase {
constructor() {
// Temporary forcing port 3000 for development
super(window.location.href.split('?')[0].replace('8080', '3000') + 'api/databases/units/aircraftdatabase');
super(window.location.href.split('?')[0] + 'api/databases/units/aircraftdatabase');
}
getCategory() {

View File

@ -4,8 +4,7 @@ import { UnitDatabase } from "./unitdatabase"
export class GroundUnitDatabase extends UnitDatabase {
constructor() {
// Temporary forcing port 3000 for development
super(window.location.href.split('?')[0].replace('8080', '3000') + 'api/databases/units/groundunitdatabase');
super(window.location.href.split('?')[0] + 'api/databases/units/groundunitdatabase');
}
getSpawnPointsByName(name: string) {

View File

@ -4,8 +4,7 @@ import { UnitDatabase } from "./unitdatabase"
export class HelicopterDatabase extends UnitDatabase {
constructor() {
// Temporary forcing port 3000 for development
super(window.location.href.split('?')[0].replace('8080', '3000') + 'api/databases/units/helicopterdatabase');
super(window.location.href.split('?')[0] + 'api/databases/units/helicopterdatabase');
}
getSpawnPointsByName(name: string) {

View File

@ -4,8 +4,7 @@ import { UnitDatabase } from "./unitdatabase"
export class NavyUnitDatabase extends UnitDatabase {
constructor() {
// Temporary forcing port 3000 for development
super(window.location.href.split('?')[0].replace('8080', '3000') + 'api/databases/units/navyunitdatabase');
super(window.location.href.split('?')[0] + 'api/databases/units/navyunitdatabase');
}
getSpawnPointsByName(name: string) {

View File

@ -4,4 +4,5 @@ import react from '@vitejs/plugin-react'
// https://vitejs.dev/config/
export default defineConfig({
plugins: [react()],
base: "/vite"
})