Initial Commit

This commit is contained in:
DOMINIK SCHRADER
2025-12-01 11:30:25 +01:00
commit 007dfc57fd
20 changed files with 1313 additions and 0 deletions

27
router.php Normal file
View File

@@ -0,0 +1,27 @@
<?php
$path = parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH);
// API an index.php routen
if (strpos($path, '/api/') === 0) {
require __DIR__ . '/index.php';
return true;
}
// Statische Dateien ausliefern
if ($path !== '/' && file_exists(__DIR__ . $path)) {
return false;
}
// Root -> public/index.html
if ($path === '/') {
$file = __DIR__ . '/public/index.html';
if (file_exists($file)) {
header('Content-Type: text/html; charset=UTF-8');
readfile($file);
return true;
}
}
// Fallback an index.php
require __DIR__ . '/index.php';
return true;