pub const FS_DIR: &str = "doc/static";
pub fn lookup(name: &str) -> Option<(&'static str, &'static [u8])> {
let name = name.trim_start_matches('/');
let key = if name.is_empty() { "index.html" } else { name };
match key {
"index.html" => Some(("text/html", include_bytes!("static/index.html"))),
"index.css" => Some(("text/css", include_bytes!("static/index.css"))),
"swagger-ui.css" => Some(("text/css", include_bytes!("static/swagger-ui.css"))),
"swagger-ui.js" => Some(("application/javascript", include_bytes!("static/swagger-ui.js"))),
"swagger-ui-bundle.js" => {
Some(("application/javascript", include_bytes!("static/swagger-ui-bundle.js")))
}
"swagger-ui-standalone-preset.js" => Some((
"application/javascript",
include_bytes!("static/swagger-ui-standalone-preset.js"),
)),
"swagger-ui-es-bundle.js" => Some((
"application/javascript",
include_bytes!("static/swagger-ui-es-bundle.js"),
)),
"swagger-ui-es-bundle-core.js" => Some((
"application/javascript",
include_bytes!("static/swagger-ui-es-bundle-core.js"),
)),
"swagger-initializer.js" => Some((
"application/javascript",
include_bytes!("static/swagger-initializer.js"),
)),
"oauth2-redirect.html" => {
Some(("text/html", include_bytes!("static/oauth2-redirect.html")))
}
"oauth2-redirect.js" => Some((
"application/javascript",
include_bytes!("static/oauth2-redirect.js"),
)),
"favicon-16x16.png" => {
Some(("image/png", include_bytes!("static/favicon-16x16.png")))
}
"favicon-32x32.png" => {
Some(("image/png", include_bytes!("static/favicon-32x32.png")))
}
_ => None,
}
}