use axum::http::header::CONTENT_TYPE;
use axum::response::IntoResponse;
const OPENAPI_JSON: &str = include_str!("openapi.json");
const DOCS_HTML: &str = r#"<!doctype html>
<html lang="en">
<head>
<title>sbol-db API</title>
<meta charset="utf-8" />
<meta name="viewport" content="width=device-width, initial-scale=1" />
<link rel="icon" href="data:," />
<style>
body { margin: 0; }
</style>
</head>
<body>
<script id="api-reference" data-url="/openapi.json"></script>
<script>
var configuration = {
theme: "purple",
layout: "modern",
hideClientButton: false
};
document.getElementById("api-reference").dataset.configuration =
JSON.stringify(configuration);
</script>
<script src="https://cdn.jsdelivr.net/npm/@scalar/api-reference"></script>
</body>
</html>
"#;
pub async fn openapi_json() -> impl IntoResponse {
([(CONTENT_TYPE, "application/json")], OPENAPI_JSON)
}
pub async fn docs_html() -> impl IntoResponse {
([(CONTENT_TYPE, "text/html; charset=utf-8")], DOCS_HTML)
}