<?php
ob_start();
// api/get_config.php
require_once '../auth.php';
require_once '../config.php';

checkApiLogin();

if (ob_get_level() > 0)
    ob_clean();
$file = '../config/sensor_layout.json';

if (file_exists($file)) {
    $content = file_get_contents($file);
    header('Content-Type: application/json');
    echo $content;
} else {
    header('Content-Type: application/json');
    echo json_encode(['sensors' => []]);
}
exit;
?>