pub fn get_mime_type(path: &str) -> Option<&'static str> { let (_, extension) = path.rsplit_once('.')?; Some(match extension.to_ascii_lowercase().as_str() { "js" | "mjs" | "cjs" => "text/javascript; charset=utf-8", "jsx" => "text/jsx; charset=utf-8", "ts" | "mts" | "cts" => "text/typescript; charset=utf-8", "tsx" => "text/tsx; charset=utf-8", "json" | "map" => "application/json; charset=utf-8", "css" => "text/css; charset=utf-8", "html" => "text/html; charset=utf-8", "txt" => "text/plain; charset=utf-8", "md" => "text/markdown; charset=utf-8", "svg" => "image/svg+xml; charset=utf-8", "wasm" => "application/wasm", _ => return None, }) }