<?php
header('Content-Type: application/json');
header('Access-Control-Allow-Origin: *');

$dataFile = __DIR__ . '/../data/appointments.json';

$appointments = [];
if (file_exists($dataFile)) {
    $content = file_get_contents($dataFile);
    $appointments = json_decode($content, true) ?: [];
}

echo json_encode(['success' => true, 'appointments' => $appointments]);
