diff --git a/backend/.env.example b/backend/.env.example index d613217..c0bcc3c 100755 --- a/backend/.env.example +++ b/backend/.env.example @@ -42,4 +42,3 @@ CLOUDFLARE_ZONE_ID=your-zone-id CPANEL_HOST=https://cpanel.yourdomain.com:2083 CPANEL_USERNAME=your-cpanel-username CPANEL_API_TOKEN=your-cpanel-api-token - diff --git a/backend/cmd/api/main.go b/backend/cmd/api/main.go index fd91659..d332c98 100755 --- a/backend/cmd/api/main.go +++ b/backend/cmd/api/main.go @@ -4,6 +4,7 @@ import ( "log" "net/http" "os" + "strings" "github.com/joho/godotenv" "github.com/rede5/gohorsejobs/backend/docs" @@ -38,6 +39,10 @@ func main() { if apiHost == "" { apiHost = "localhost:8521" } + // Strip protocol schemes if present to ensure clean host for Swagger + apiHost = strings.TrimPrefix(apiHost, "http://") + apiHost = strings.TrimPrefix(apiHost, "https://") + docs.SwaggerInfo.Host = apiHost docs.SwaggerInfo.Schemes = []string{"http", "https"}