<?php
$dotenv = parse_ini_file('.env');

header('Content-Type: application/json');

if (isset($dotenv['MAPBOX_API_KEY']) && $dotenv['MAPBOX_API_KEY']) {
    echo json_encode(['success' => true, 'key' => $dotenv['MAPBOX_API_KEY']]);
} else {
    echo json_encode(['success' => false, 'message' => 'MapBox API key not configured']);
}
?>