This commit is contained in:
2025-11-30 02:51:15 +01:00
parent 3ebfb8c7f6
commit 2fb5093c7f
9 changed files with 217 additions and 205 deletions

43
api/router.v1.php Normal file
View File

@@ -0,0 +1,43 @@
<?php
// /api/router.v1.php
declare(strict_types=1);
// Pfad erneut auslesen
$uri = parse_url($_SERVER['REQUEST_URI'] ?? '/', PHP_URL_PATH);
$path = rtrim($uri, '/');
// Namespace v1
switch ($path) {
case '/v1/quickcheck':
require __DIR__ . '/v1/target/quickcheck.php'; // dein bestehendes File
if (!function_exists('quickcheck_handle_request')) {
http_response_code(500);
echo json_encode(['ok' => false, 'error' => 'Handler quickcheck_handle_request not found']);
exit;
}
$result = quickcheck_handle_request();
echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
break;
case '/v1/browser.quick.test':
require __DIR__ . '/v1/result/browser.quick.test.php';
if (!function_exists('browser_quick_test_handle_request')) {
http_response_code(500);
echo json_encode(['ok' => false, 'error' => 'Handler browser_quick_test_handle_request not found']);
exit;
}
browser_quick_test_handle_request();
break;
default:
http_response_code(404);
echo json_encode([
'ok' => false,
'error' => 'Unknown v1 endpoint',
'path' => $path,
], JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
break;
}