summaryrefslogtreecommitdiffhomepage
path: root/bin/serve
diff options
context:
space:
mode:
Diffstat (limited to 'bin/serve')
-rwxr-xr-xbin/serve18
1 files changed, 18 insertions, 0 deletions
diff --git a/bin/serve b/bin/serve
new file mode 100755
index 0000000..931e2db
--- /dev/null
+++ b/bin/serve
@@ -0,0 +1,18 @@
+#!/usr/bin/env bash
+set -euo pipefail
+
+SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
+cd "$SCRIPT_DIR"
+
+BUILD_DIR="build-web"
+
+if [ ! -f "$BUILD_DIR/index.html" ]; then
+ echo "Error: Web build not found. Run 'bin/build-web' first."
+ exit 1
+fi
+
+PORT="${1:-8080}"
+
+echo "Serving study-player at http://localhost:$PORT"
+echo "Press Ctrl+C to stop."
+python3 -m http.server "$PORT" -d "$BUILD_DIR"