1
0
mirror of https://github.com/muety/wakapi.git synced 2023-08-10 21:12:56 +03:00

fix: swagger ui (resolve #421)

This commit is contained in:
Ferdinand Mütsch 2022-10-14 12:00:56 +02:00
parent 060a33263a
commit 777997c883

View File

@ -35,6 +35,8 @@ import (
_ "gorm.io/driver/sqlite" _ "gorm.io/driver/sqlite"
"gorm.io/gorm" "gorm.io/gorm"
"gorm.io/gorm/logger" "gorm.io/gorm/logger"
_ "github.com/muety/wakapi/static/docs"
) )
// Embed version.txt // Embed version.txt
@ -282,6 +284,7 @@ func main() {
router.PathPrefix("/contribute.json").Handler(staticFileServer) router.PathPrefix("/contribute.json").Handler(staticFileServer)
router.PathPrefix("/assets").Handler(assetsFileServer) router.PathPrefix("/assets").Handler(assetsFileServer)
router.Path("/swagger-ui").Handler(http.RedirectHandler("swagger-ui/", http.StatusMovedPermanently)) // https://github.com/swaggo/http-swagger/issues/44
router.PathPrefix("/swagger-ui").Handler(httpSwagger.WrapHandler) router.PathPrefix("/swagger-ui").Handler(httpSwagger.WrapHandler)
// Listen HTTP // Listen HTTP