Skip to content

Commit ceb8c79

Browse files
authored
Merge pull request #2 from JMLamodiere/swaggerui
add github pages index.html with swagger ui
2 parents 4ca0446 + fe017b3 commit ceb8c79

File tree

1 file changed

+31
-0
lines changed

1 file changed

+31
-0
lines changed

doc/index.html

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
<!DOCTYPE html>
2+
<html lang="en">
3+
<head>
4+
<meta charset="UTF-8">
5+
<title>TDD Demo ForumPHP 2020</title>
6+
<link rel="stylesheet" type="text/css" href="https://unpkg.com/swagger-ui-dist@3/swagger-ui.css"/>
7+
</head>
8+
<body>
9+
<div id="swagger-ui"></div> <!-- Div to hold the UI component -->
10+
<!-- Load the latest Swagger UI code and style from npm using unpkg.com -->
11+
<script src="https://unpkg.com/swagger-ui-dist@3/swagger-ui-bundle.js"></script>
12+
<script>
13+
window.onload = function () {
14+
// Begin Swagger UI call region
15+
const ui = SwaggerUIBundle({
16+
url: "openapi.yml", //Location of Open API spec in the repo
17+
dom_id: '#swagger-ui',
18+
deepLinking: true,
19+
presets: [
20+
SwaggerUIBundle.presets.apis,
21+
SwaggerUIBundle.SwaggerUIStandalonePreset
22+
],
23+
plugins: [
24+
SwaggerUIBundle.plugins.DownloadUrl
25+
],
26+
})
27+
window.ui = ui
28+
}
29+
</script>
30+
</body>
31+
</html>

0 commit comments

Comments
 (0)