1
0
mirror of https://github.com/thib8956/tic-tac-toe-ws.git synced 2026-02-21 07:48:12 +00:00

feat: containerize server with Docker

This commit is contained in:
2026-02-19 13:02:50 +01:00
parent ae7c3a4662
commit 366847e1bd
8 changed files with 75 additions and 5 deletions

View File

@@ -1,13 +1,16 @@
import type { Click, Update, Message, Hello, EndGame, Spectate } from "common.js";
const ANIMATE_DURATION = 500; // ms
declare global {
interface Window {
TIC_TAC_TOE_CONFIG?: { WS_URL?: string };
}
}
const ANIMATE_DURATION = 500;
const GRID_PADDING = 10;
const MESSAGE_PADDING = 20;
let address = "ws://localhost:1234";
if (window.location.hostname !== "localhost") {
address = "wss://tic-tac-toe-ws-production.up.railway.app";
}
const address = window.TIC_TAC_TOE_CONFIG?.WS_URL || "ws://localhost:1234";
const ws = new WebSocket(address);
interface Point {