@mocobaas/swagger-mods
v1.0.7
Published
Customized Swagger Mods for MocoBaaS
Downloads
7
Readme
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta charset="UTF-8" />
<title>Swagger UI</title>
<link rel="stylesheet" type="text/css" href="https://unpkg.com/[email protected]/swagger-ui.css" />
<link rel="stylesheet" href="https://fonts.googleapis.com/icon?family=Material+Icons" />
</head>
<body>
<div id="swagger-ui"></div>
<script src="https://unpkg.com/[email protected]/swagger-ui-standalone-preset.js"></script>
<script src="https://unpkg.com/[email protected]/swagger-ui-bundle.js"></script>
<script src="/dist/mbaas-swagger.js"></script>
<script>
window.onload = function () {
const uri = "https://your.url.my/public/customapi.json";
const mod = new SwaggerMod(uri);
// Build a system
const ui = SwaggerUIBundle({
url: uri,
dom_id: "#swagger-ui",
deepLinking: true,
presets: [SwaggerUIBundle.presets.apis, SwaggerUIStandalonePreset],
plugins: [SwaggerUIBundle.plugins.DownloadUrl],
layout: "StandaloneLayout",
requestInterceptor: mod.interceptRequest(),
responseInterceptor: mod.interceptResponse(),
});
window.ui = ui;
};
</script>
</body>
</html>