<?php
// CORS headers for web interface
header("Access-Control-Allow-Origin: *");
header("Access-Control-Allow-Methods: POST, GET, OPTIONS");
header("Access-Control-Allow-Headers: Content-Type");
header("Content-Type: application/json; charset=UTF-8");

// Handle preflight OPTIONS request
if ($_SERVER['REQUEST_METHOD'] === 'OPTIONS') {
    http_response_code(200);
    exit();
}

// include database and object files
include_once '../config/database.php';
include_once '../config/cache.php';

// get database connection
$database = new Database();
$db = $database->getConnection();
?>