Skip to content

Commit b245b4c

Browse files
authored
Merge pull request #53 from KtorZ/fix/redoc-template-nested-paths
Allow swagger-servant-ui with redoc to be nested in an API
2 parents fdb6106 + 22f904e commit b245b4c

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

servant-swagger-ui-redoc/redoc.index.html.tmpl

+9-1
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,17 @@
77
<style>
88
body { margin: 0; padding: 0; }
99
</style>
10+
<script>
11+
// Force Strict-URL Routing for assets relative paths
12+
(function onload() {
13+
if (!window.location.href.endsWith("/")) {
14+
window.location.href += "/";
15+
}
16+
}());
17+
</script>
1018
</head>
1119
<body>
12-
<redoc spec-url='/SERVANT_SWAGGER_UI_SCHEMA'></redoc>
20+
<redoc spec-url='../SERVANT_SWAGGER_UI_SCHEMA'></redoc>
1321
<script src="redoc.min.js"> </script>
1422
</body>
1523
</html>

0 commit comments

Comments
 (0)