#!/bin/sh
set -eu
cat > /usr/share/nginx/html/config.js <<EOF
window.MCCARS_CONFIG = {
  SUPABASE_URL: "${SUPABASE_URL:-http://localhost:8000}",
  SUPABASE_ANON_KEY: "${SUPABASE_ANON_KEY:-}",
  N8N_WEBHOOK_URL: "${N8N_WEBHOOK_URL:-http://localhost:55590}"
};
EOF
exec nginx -g "daemon off;"
