'text/css', 'js' => 'application/javascript', 'json' => 'application/json', 'png' => 'image/png', 'jpg' => 'image/jpeg', 'jpeg' => 'image/jpeg', 'gif' => 'image/gif', 'svg' => 'image/svg+xml', 'ico' => 'image/x-icon', 'woff' => 'font/woff', 'woff2' => 'font/woff2', 'ttf' => 'font/ttf', 'eot' => 'application/vnd.ms-fontobject', 'webp' => 'image/webp', 'mp4' => 'video/mp4', 'webm' => 'video/webm', ]; $ext = strtolower(pathinfo($filePath, PATHINFO_EXTENSION)); if (isset($mimeTypes[$ext])) { header('Content-Type: ' . $mimeTypes[$ext]); } readfile($filePath); exit; } header('Content-Type: text/html; charset=UTF-8'); readfile($publicDir . '/index.html');