[openapi] Allow subdir serving

by using relative URLs

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2021-10-10 01:40:44 +02:00
parent 8e2f1f649a
commit 87732995b3
Signed by: luzifer
GPG key ID: 0066F03ED215AD7D
2 changed files with 2 additions and 2 deletions

View file

@ -22,7 +22,7 @@ var (
Version: "v1", Version: "v1",
}, },
Servers: []*spec.Server{ Servers: []*spec.Server{
{URL: "/", Description: "Current bot instance"}, {URL: "./", Description: "Current bot instance"},
}, },
Paths: make(spec.Paths), Paths: make(spec.Paths),
Components: &spec.Components{ Components: &spec.Components{

View file

@ -14,7 +14,7 @@
// Begin Swagger UI call region // Begin Swagger UI call region
const ui = SwaggerUIBundle({ const ui = SwaggerUIBundle({
urls: [{ name: 'Bot-API specification', url: '/openapi.json' }], urls: [{ name: 'Bot-API specification', url: 'openapi.json' }],
"dom_id": "#swagger-ui", "dom_id": "#swagger-ui",
deepLinking: true, deepLinking: true,
presets: [ presets: [