#!/bin/bash
# ─────────────────────────────────────────
# SG Merchant Generator — Local Server
# Double-click this file to start server
# ─────────────────────────────────────────

DIR="$(cd "$(dirname "$0")" && pwd)"
PORT=8080
URL="http://localhost:${PORT}/merchant_generator.html"

echo "Starting local HTTP server on port $PORT..."
echo "Opening: $URL"
echo ""
echo "Press Ctrl+C to stop the server."
echo "─────────────────────────────────────────"

cd "$DIR"

# Open browser after short delay
(sleep 1.5 && open "$URL") &

# Start Python HTTP server
python3 server.py
