#!/usr/bin/env bash
set -euo pipefail

ROOT="$(cd "$(dirname "$0")/.." && pwd)"
OUTPUT="$ROOT/docs/api/index.html"

python3 "$(dirname "$0")/generate-api-docs.py" "$OUTPUT"

PORT=8500
echo "Serving at http://localhost:$PORT"
echo "Press Ctrl+C to stop."
open "http://localhost:$PORT/docs/api/index.html"
cd "$ROOT" && python3 -m http.server $PORT --bind 127.0.0.1
