diff --git a/app/app.go b/app/app.go index 7cfcf28..db60301 100644 --- a/app/app.go +++ b/app/app.go @@ -50,18 +50,18 @@ func getCompanyLogo(location string) ([]byte, error) { } func registerHandlers(a *App) { - a.fiberApp.Get("/favicon.ico", func(c *fiber.Ctx) error { + a.fiberApp.Get("/docs/favicon.ico", func(c *fiber.Ctx) error { return c.Send(a.logo) }) // Serve static files - a.fiberApp.Static("/", staticFilesPath) + a.fiberApp.Static("/docs/", staticFilesPath) - a.fiberApp.Get("/", a.getIndexHandler) - a.fiberApp.Get("/:version/:role", a.renderDocHandler) + a.fiberApp.Get("/docs/", a.getIndexHandler) + a.fiberApp.Get("/docs/:version/:role", a.renderDocHandler) - a.fiberApp.Get("/versions", a.getVersionsHandler) - a.fiberApp.Get("/version/:version/roles", a.getRolesHandler) + a.fiberApp.Get("/docs/versions", a.getVersionsHandler) + a.fiberApp.Get("/docs/version/:version/roles", a.getRolesHandler) } func validateConfig(cfg *Config) error { diff --git a/public/script.js b/public/script.js index 01a47aa..89c1af8 100644 --- a/public/script.js +++ b/public/script.js @@ -3,7 +3,7 @@ window.onload = function () { }; function setupVersionSelect() { - fetch('/versions') + fetch('/docs/versions') .then(response => response.json()) .then(versions => { var dropdown = document.getElementById('dropdown'); @@ -22,7 +22,7 @@ function setupVersionSelect() { function handleVersionSelect() { const version = document.getElementById('dropdown').value; - fetch(`/version/${version}/roles`) + fetch(`/docs/version/${version}/roles`) .then(response => response.json()) .then(roles => { buttonContainer = document.getElementById('button-container'); @@ -32,7 +32,7 @@ function handleVersionSelect() { button.innerHTML = role; button.onclick = function () { - window.location.href = `/${version}/${role}`; + window.location.href = `/docs/${version}/${role}`; }; buttonContainer.appendChild(button); diff --git a/views/layouts/main.html b/views/layouts/main.html index 64461e4..4d721ac 100644 --- a/views/layouts/main.html +++ b/views/layouts/main.html @@ -5,7 +5,7 @@