#!/bin/bash
set -e

SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)"
PROJECT_DIR="$(cd "$SCRIPT_DIR/.." && pwd)"

# Source environment (silently)
source "$PROJECT_DIR/.env" 2>/dev/null || true
source "$PROJECT_DIR/.env.development" 2>/dev/null || true

# Ensure PATH is set
export PATH="/opt/homebrew/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:$PATH"

exec "$PROJECT_DIR/target/debug/momentry_playground" server --host 0.0.0.0