如何在本地替换swagger-ui.css,swagger-ui-standalone-preset.js和swagger-ui-bundle.js

时间:2018-08-14 23:58:46

标签: swagger-ui

我想将swagger-ui.css,swagger-ui-standalone-preset.js和swagger-ui-bundle.js放在本地,所以我在下面做了:

const swaggerUiAssetPath = require("swagger-ui-dist").getAbsoluteFSPath();
<link rel="stylesheet" type="text/css" href=${ swaggerUiAssetPath + 
"swagger-ui.css"}>
<script src=${ swaggerUiAssetPath + "swagger-ui-standalone-preset.js"}></script>
<script src=${ swaggerUiAssetPath + "swagger-ui-bundle.js"}></script>

但它给出了referenceError:swaggerUIBundle未定义。有谁知道如何解决问题,

0 个答案:

没有答案