v0.9.2 web and wasm changes for deployment

This commit is contained in:
2026-02-27 18:35:49 -05:00
parent fc8a6ba6a6
commit 16fc069a8f
4 changed files with 54 additions and 27 deletions

View File

@ -0,0 +1,11 @@
//go:build js && wasm
package main
import "syscall/js"
// Derive base URL from the page's own origin at runtime
// When served via nginx at domain.com, origin = "https://domain.com"
// and the chess API proxy lives at /chess — so BaseURL = "https://comain.com/chess".
// Works correctly for any deployment domain without rebuilding
var defaultAPIBase = js.Global().Get("location").Get("origin").String() + "/chess"