-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
68 lines (64 loc) · 2.35 KB
/
index.html
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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
<html>
<head>
<script src="https://unpkg.com/swagger-ui-dist@4/swagger-ui-bundle.js"></script>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@4/swagger-ui.css"/>
<title>Mapp Intelligence AnalyticsAPI</title>
</head>
<body>
<div id="swagger-ui"></div>
<script>
window.onload = function () {
window.ui = window.location.pathname.includes('Mapp-Intelligence-API-Docs') ?
loadProdSwagger() : loadStageSwagger();
}
function loadProdSwagger() {
return loadSwagger("analytics-api-full.yaml");
}
function loadSwagger(url, additionalPlugins = []) {
return SwaggerUIBundle({
url: url,
dom_id: '#swagger-ui',
deepLinking: true,
presets: [
SwaggerUIBundle.presets.apis,
SwaggerUIBundle.SwaggerUIStandalonePreset
],
plugins: [
SwaggerUIBundle.plugins.DownloadUrl,
...additionalPlugins
],
});
}
function loadStageSwagger() {
const stagePlugins = [
() => {
return {
statePlugins: {
spec: {
wrapActions: {
updateJsonSpec: function (oriAction, system) {
return (spec) => {
spec.servers = [
{
url: 'https://intelligence-int.nbg.webtrekk.com/analytics/api/',
description: 'INT'
},
{
url: 'https://intelligence-qa.nbg.webtrekk.com/analytics/api/',
description: 'QA'
}
];
return oriAction(spec);
};
}
}
}
}
};
}
];
return loadSwagger("analytics-api-full.yaml", stagePlugins);
}
</script>
</body>
</html>