<?php
/**
 * Router for PHP built-in server — serves from public/ directory
 */
$uri = urldecode(parse_url($_SERVER['REQUEST_URI'], PHP_URL_PATH));

// Serve static assets
if (preg_match('/\.(css|js|png|jpg|jpeg|gif|ico|woff|woff2|ttf|svg)$/', $uri)) {
    return false;
}

// Map to file
$path = ltrim($uri, '/');
if ($path === '' || $path === 'index') {
    require __DIR__ . '/index.php'; return;
}
if (file_exists(__DIR__ . '/' . $path)) {
    require __DIR__ . '/' . $path; return;
}
if (file_exists(__DIR__ . '/' . $path . '.php')) {
    require __DIR__ . '/' . $path . '.php'; return;
}

http_response_code(404);
echo '404 Not Found: ' . htmlspecialchars($uri);---
books               notes               users               verses_fts_docsize
chapters            people              verses              verses_fts_idx    
event_scriptures    progress            verses_fts        
events              quiz_questions      verses_fts_config 
highlights          quiz_results        verses_fts_data   
