mirror of
https://github.com/openfrontio/OpenFrontIO.git
synced 2026-07-09 14:08:09 +00:00
configure nginx to run in container
This commit is contained in:
@@ -585,7 +585,7 @@ export class HostLobbyModal extends LitElement {
|
||||
|
||||
private async putGameConfig() {
|
||||
const response = await fetch(
|
||||
`${getServerConfig().workerPath(this.lobbyId)}/game/${this.lobbyId}`,
|
||||
`${window.location.origin}/${getServerConfig().workerPath(this.lobbyId)}/game/${this.lobbyId}`,
|
||||
{
|
||||
method: "PUT",
|
||||
headers: {
|
||||
@@ -610,7 +610,7 @@ export class HostLobbyModal extends LitElement {
|
||||
);
|
||||
this.close();
|
||||
const response = await fetch(
|
||||
`${getServerConfig().workerPath(this.lobbyId)}/start_game/${this.lobbyId}`,
|
||||
`${window.location.origin}/${getServerConfig().workerPath(this.lobbyId)}/start_game/${this.lobbyId}`,
|
||||
{
|
||||
method: "POST",
|
||||
headers: {
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { LitElement, html, css } from "lit";
|
||||
import { customElement, property, state, query } from "lit/decorators.js";
|
||||
import { GameMapType, GameType } from "../core/game/Game";
|
||||
import { LitElement, css, html } from "lit";
|
||||
import { customElement, query, state } from "lit/decorators.js";
|
||||
import { getServerConfig } from "../core/configuration/Config";
|
||||
import { consolex } from "../core/Consolex";
|
||||
import { getConfig, getServerConfig } from "../core/configuration/Config";
|
||||
import { GameMapType, GameType } from "../core/game/Game";
|
||||
import { GameInfo } from "../core/Schemas";
|
||||
|
||||
@customElement("join-private-lobby-modal")
|
||||
@@ -360,7 +360,7 @@ export class JoinPrivateLobbyModal extends LitElement {
|
||||
consolex.log(`Joining lobby with ID: ${lobbyId}`);
|
||||
this.message = "Checking lobby..."; // Set initial message
|
||||
|
||||
const url = `${window.location.origin}/${getServerConfig().workerPath(lobbyId)}/game/${lobbyId}/exists`;
|
||||
const url = `/${getServerConfig().workerPath(lobbyId)}/game/${lobbyId}/exists`;
|
||||
fetch(url, {
|
||||
method: "GET",
|
||||
headers: {
|
||||
@@ -400,7 +400,7 @@ export class JoinPrivateLobbyModal extends LitElement {
|
||||
if (!this.lobbyIdInput?.value) return;
|
||||
|
||||
fetch(
|
||||
`${getServerConfig().workerPath(this.lobbyIdInput.value)}/lobby/${this.lobbyIdInput.value}`,
|
||||
`/${getServerConfig().workerPath(this.lobbyIdInput.value)}/game/${this.lobbyIdInput.value}`,
|
||||
{
|
||||
method: "GET",
|
||||
headers: {
|
||||
|
||||
@@ -45,7 +45,7 @@ export class PublicLobby extends LitElement {
|
||||
|
||||
async fetchLobbies(): Promise<GameInfo[]> {
|
||||
try {
|
||||
const response = await fetch("/public_lobbies");
|
||||
const response = await fetch(`/public_lobbies`);
|
||||
if (!response.ok)
|
||||
throw new Error(`HTTP error! status: ${response.status}`);
|
||||
const data = await response.json();
|
||||
|
||||
Reference in New Issue
Block a user