<?php
header('Content-Type: application/json; charset=utf-8');
header('Access-Control-Allow-Origin: *');
header('Access-Control-Allow-Methods: POST');
header('Access-Control-Allow-Headers: Content-Type');

error_log("DEBUG: API called");

// Debug-Ausgabe
echo json_encode([
    'success' => true,
    'message' => 'Debug API Test',
    'method' => $_SERVER['REQUEST_METHOD'] ?? 'UNKNOWN',
    'input' => file_get_contents('php://input'),
    'timestamp' => date('Y-m-d H:i:s')
]);

error_log("DEBUG: JSON sent");
?>
