-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathswagger-viewer.html
More file actions
36 lines (35 loc) · 1.12 KB
/
swagger-viewer.html
File metadata and controls
36 lines (35 loc) · 1.12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Histogram API v1 - Swagger UI</title>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@4.5.0/swagger-ui.css" />
<style>
html { box-sizing: border-box; overflow: -moz-scrollbars-vertical; overflow-y: scroll; }
*, *:before, *:after { box-sizing: inherit; }
body { margin: 0; background: #fafafa; }
</style>
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/swagger-ui-dist@4.5.0/swagger-ui-bundle.js"></script>
<script>
window.onload = function() {
// Get the current hostname and use it to build the API docs URL
const baseUrl = window.location.protocol + "//" + window.location.host;
const apiDocsUrl = baseUrl + "/api-docs.json";
const ui = SwaggerUIBundle({
url: apiDocsUrl,
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIBundle.SwaggerUIStandalonePreset
],
layout: "BaseLayout"
});
window.ui = ui;
};
</script>
</body>
</html>