Add www/api/public/index.php

This commit is contained in:
2026-04-25 10:45:27 +02:00
parent 26d13d03e3
commit f1a7dc5638

20
www/api/public/index.php Normal file
View File

@@ -0,0 +1,20 @@
<?php
/**
* api.domain.de — REST API
*/
header('Content-Type: application/json');
$method = $_SERVER['REQUEST_METHOD'];
switch ($method) {
case 'GET':
echo json_encode(['status' => 'ok', 'message' => 'API läuft']);
break;
case 'POST':
$input = json_decode(file_get_contents('php://input'), true);
echo json_encode(['status' => 'received', 'data' => $input]);
break;
default:
http_response_code(405);
echo json_encode(['error' => 'Method not allowed']);
}