Skip to content

Commit

Permalink
fix(middleware-schemator): config is not defined
Browse files Browse the repository at this point in the history
  • Loading branch information
game5413 committed Aug 21, 2021
1 parent 9214498 commit 1ee3733
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion packages/schemator/methods/render.js
Expand Up @@ -14,7 +14,8 @@
* schematorInstance.render({ title: 'Docs' })
*/
export default function renderSwagger(config) {
return async (req, res) =>
return async (req, res) => {
res.end(`<!DOCTYPE html><html lang="en"><head>
<meta charset="UTF-8"><title>${(config && config.title) || 'Schemator'}</title><link rel="stylesheet" type="text/css" href="./swagger-ui-dist/swagger-ui.css" ><link rel="icon" type="image/png" href="./swagger-ui-dist/favicon-32x32.png" sizes="32x32" /><link rel="icon" type="image/png" href="./swagger-ui-dist/favicon-16x16.png" sizes="16x16" /><style>html{box-sizing:border-box;overflow:-moz-scrollbars-vertical;overflow-y:scroll}*,:after,:before{box-sizing:inherit}body{margin:0;background:#fafafa}</style></head><body><div id="swagger-ui"></div><script src="./swagger-ui-dist/swagger-ui-bundle.js"> </script><script src="./swagger-ui-dist/swagger-ui-standalone-preset.js"></script><script>window.onload=function(){const o=SwaggerUIBundle({url:window.location.protocol+"//"+window.location.host+"${config.exposePath}",dom_id:"#swagger-ui",deepLinking:!0,presets:[SwaggerUIBundle.presets.apis,SwaggerUIStandalonePreset],plugins:[SwaggerUIBundle.plugins.DownloadUrl],layout:"StandaloneLayout"});window.ui=o};</script></body></html>`);
}
}

0 comments on commit 1ee3733

Please sign in to comment.