Aktueller Stand
This commit is contained in:
9
backend/node_modules/@fastify/swagger-ui/lib/index-html.js
generated
vendored
9
backend/node_modules/@fastify/swagger-ui/lib/index-html.js
generated
vendored
@@ -1,10 +1,13 @@
|
||||
'use strict'
|
||||
|
||||
function indexHtml (opts) {
|
||||
const hasLeadingSlash = /^\//.test(opts.prefix)
|
||||
let routePrefix = opts.prefix
|
||||
if (opts.indexPrefix) {
|
||||
routePrefix = `${opts.indexPrefix.replace(/\/$/, '')}/${opts.prefix.replace(/^\//, '')}`
|
||||
}
|
||||
return (url) => {
|
||||
const hasTrailingSlash = /\/$/.test(url)
|
||||
const prefix = hasTrailingSlash ? `.${opts.staticPrefix}` : `${hasLeadingSlash ? '.' : ''}${opts.prefix}${opts.staticPrefix}`
|
||||
const prefix = hasTrailingSlash ? `.${opts.staticPrefix}` : `${routePrefix}${opts.staticPrefix}`
|
||||
return `<!-- HTML for static distribution bundle build -->
|
||||
<!DOCTYPE html>
|
||||
<html lang="en">
|
||||
@@ -21,7 +24,7 @@ function indexHtml (opts) {
|
||||
<link rel="icon" type="image/png" href="${prefix}/favicon-16x16.png" sizes="16x16" />
|
||||
`}
|
||||
</head>
|
||||
|
||||
|
||||
<body>
|
||||
<div id="swagger-ui"></div>
|
||||
<script src="${prefix}/swagger-ui-bundle.js" charset="UTF-8"> </script>
|
||||
|
||||
Reference in New Issue
Block a user