fix(config): remove duplicate API_HOST and strip protocol prefix in main.go
This commit is contained in:
parent
0a69406b31
commit
52f31710cf
2 changed files with 5 additions and 1 deletions
|
|
@ -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
|
||||
|
||||
|
|
|
|||
|
|
@ -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"}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue