Skip to content

Commit

Permalink
Merge pull request #229 from openinfradev/change_swagger_url
Browse files Browse the repository at this point in the history
trivial. minor fix
  • Loading branch information
cho4036 authored Feb 8, 2024
2 parents 99f571a + c5cdeec commit ff35f44
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion cmd/server/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"net/http"
"strconv"
"strings"

"github.com/spf13/pflag"
"github.com/spf13/viper"
Expand Down Expand Up @@ -74,7 +75,13 @@ func init() {
log.Error(err)
}

swagger.SwaggerInfo.Host = viper.GetString("external-address")
address := viper.GetString("external-address")
arr := strings.Split(address, "//")
if len(arr) >= 2 {
address = arr[1]
}

swagger.SwaggerInfo.Host = address
}

// @title tks-api service
Expand Down

0 comments on commit ff35f44

Please sign in to comment.