Merge pull request #46 from rede5/feat/dokku-setup
fix(swagger): usar URL relativa para doc.json
This commit is contained in:
commit
348d99abd9
1 changed files with 2 additions and 8 deletions
|
|
@ -2,7 +2,6 @@ package main
|
|||
|
||||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"log"
|
||||
|
||||
"photum-backend/docs"
|
||||
|
|
@ -110,16 +109,11 @@ func main() {
|
|||
docs.SwaggerInfo.Schemes = []string{"http", "https"}
|
||||
}
|
||||
|
||||
// Swagger UI
|
||||
swaggerScheme := "http"
|
||||
if cfg.AppEnv == "production" {
|
||||
swaggerScheme = "https"
|
||||
}
|
||||
swaggerURL := fmt.Sprintf("%s://%s/swagger/doc.json", swaggerScheme, cfg.SwaggerHost)
|
||||
// Swagger UI - usando URL relativa para funcionar em qualquer ambiente
|
||||
r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler,
|
||||
ginSwagger.PersistAuthorization(true),
|
||||
ginSwagger.DeepLinking(true),
|
||||
ginSwagger.URL(swaggerURL),
|
||||
ginSwagger.URL("doc.json"),
|
||||
))
|
||||
|
||||
// Public Routes
|
||||
|
|
|
|||
Loading…
Reference in a new issue