Adding Rest API documentation page with Swgger download on the /docs endpoint
This commit is contained in:
@@ -0,0 +1,11 @@
|
||||
window.addEventListener('DOMContentLoaded', () => {
|
||||
window.ui = window.SwaggerUIBundle({
|
||||
url: '/openapi.json',
|
||||
dom_id: '#swagger-ui',
|
||||
deepLinking: true,
|
||||
docExpansion: 'list',
|
||||
persistAuthorization: true,
|
||||
displayRequestDuration: true,
|
||||
filter: true,
|
||||
});
|
||||
});
|
||||
@@ -0,0 +1,37 @@
|
||||
<!doctype html>
|
||||
<html lang="en">
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<title>Oikos API Docs</title>
|
||||
<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui.css">
|
||||
<style>
|
||||
body { margin: 0; background: #f6f8fb; }
|
||||
.docs-topbar {
|
||||
display: flex;
|
||||
gap: 12px;
|
||||
align-items: center;
|
||||
justify-content: space-between;
|
||||
padding: 14px 20px;
|
||||
background: #0f172a;
|
||||
color: #fff;
|
||||
font: 14px/1.4 system-ui, sans-serif;
|
||||
}
|
||||
.docs-links { display: flex; gap: 12px; flex-wrap: wrap; }
|
||||
.docs-links a { color: #93c5fd; text-decoration: none; }
|
||||
.docs-links a:hover { text-decoration: underline; }
|
||||
</style>
|
||||
<script src="https://cdn.jsdelivr.net/npm/swagger-ui-dist@5/swagger-ui-bundle.js" defer></script>
|
||||
<script src="/doc-assets/swagger-init.js" defer></script>
|
||||
</head>
|
||||
<body>
|
||||
<header class="docs-topbar">
|
||||
<strong>Oikos API Documentation</strong>
|
||||
<nav class="docs-links">
|
||||
<a href="/openapi.json" target="_blank" rel="noreferrer">openapi.json</a>
|
||||
<a href="/openapi.json?download=1">Download JSON</a>
|
||||
</nav>
|
||||
</header>
|
||||
<div id="swagger-ui"></div>
|
||||
</body>
|
||||
</html>
|
||||
Reference in New Issue
Block a user