Files
lux/examples/web/serve.sh
Brandon Lucas 634f665b1b feat: add stdlib and browser examples
- stdlib/html.lux: Type-safe HTML construction
- stdlib/browser.lux: Browser utilities
- examples/web/: Counter app with DOM manipulation
- examples/counter.lux: Simple counter example

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
2026-02-15 03:54:17 -05:00

27 lines
687 B
Bash
Executable File

#!/usr/bin/env bash
# Simple HTTP server for testing Lux web examples
# Usage: ./serve.sh [port]
PORT=${1:-8080}
DIR="$(dirname "$0")"
echo "Serving Lux web examples at http://localhost:$PORT"
echo "Open http://localhost:$PORT/index.html in your browser"
echo "Press Ctrl+C to stop"
echo ""
cd "$DIR"
# Try python3 first, then python, then node
if command -v python3 &> /dev/null; then
python3 -m http.server $PORT
elif command -v python &> /dev/null; then
python -m SimpleHTTPServer $PORT
elif command -v npx &> /dev/null; then
npx serve -p $PORT .
else
echo "Error: No suitable HTTP server found."
echo "Install Python or Node.js to serve files."
exit 1
fi