diff infinite_canvas/serve.sh @ 276:b55c22cff335

Add interactive infinite canvas prototype
author MrJuneJune <me@mrjunejune.com>
date Mon, 17 Aug 2026 16:57:56 -0700
parents
children
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/infinite_canvas/serve.sh	Mon Aug 17 16:57:56 2026 -0700
@@ -0,0 +1,15 @@
+#!/usr/bin/env bash
+set -eu
+
+RUNFILES_ROOT="${RUNFILES_DIR:-$0.runfiles}"
+WEB_HTML="$(find "$RUNFILES_ROOT" -path '*/infinite_canvas/web/index.html' -print -quit)"
+
+if [[ -z "$WEB_HTML" ]]; then
+  echo "Could not locate the infinite canvas web bundle." >&2
+  exit 1
+fi
+
+WEB_DIR="$(dirname "$WEB_HTML")"
+PORT="${1:-4343}"
+echo "Serving http://127.0.0.1:${PORT}/index.html"
+exec python3 -m http.server "$PORT" --bind 127.0.0.1 --directory "$WEB_DIR"