fix: allow specifing game server url in environment variable

This commit is contained in:
Ashhhleyyy 2022-08-13 16:10:22 +01:00
parent bf11761bc8
commit 2a7c87605c
Signed by: ash
GPG key ID: 83B789081A0878FB

View file

@ -31,7 +31,7 @@
function joinGame(uname: string, gameId: string) { function joinGame(uname: string, gameId: string) {
players = []; players = [];
socket = io(`http://${window.location.hostname}:3000/`); socket = io(import.meta.env.GAMESERVER_URL || `http://${window.location.hostname}:3000/`);
socket.on('connect', () => { socket.on('connect', () => {
socket.emit('joinGame', gameId, uname, (result) => { socket.emit('joinGame', gameId, uname, (result) => {
if (result.error === false) { if (result.error === false) {