Skip to content

Commit

Permalink
swagger base path to be overwritten on nginx (#56)
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-cronus authored Aug 30, 2024
1 parent 3e9cb08 commit 888a81a
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
7 changes: 4 additions & 3 deletions cmd/santa-sleigh/santa_sleigh.go
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,12 @@ func main() {
appcfg.MustLoadFromKey(applicationYamlKey, &cfg)
api.SwaggerInfo.Host = cfg.Host
api.SwaggerInfo.Version = cfg.Version
swaggerRoot := swaggerRootSuffix
nginxPrefix := ""
if cfg.Tenant != "" {
swaggerRoot = "/" + cfg.Tenant + swaggerRootSuffix
nginxPrefix = "/" + cfg.Tenant
api.SwaggerInfo.BasePath = nginxPrefix
}
server.New(new(service), applicationYamlKey, swaggerRoot).ListenAndServe(ctx, cancel)
server.New(new(service), applicationYamlKey, swaggerRootSuffix, nginxPrefix).ListenAndServe(ctx, cancel)
}

func (s *service) RegisterRoutes(router *server.Router) {
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ go 1.23
require (
github.com/goccy/go-json v0.10.3
github.com/hashicorp/go-multierror v1.1.1
github.com/ice-blockchain/eskimo v1.401.0
github.com/ice-blockchain/wintr v1.150.0
github.com/ice-blockchain/eskimo v1.402.0
github.com/ice-blockchain/wintr v1.151.0
github.com/pkg/errors v0.9.1
github.com/stretchr/testify v1.9.0
github.com/swaggo/swag v1.16.3
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -189,12 +189,12 @@ github.com/hashicorp/go-multierror v1.1.1 h1:H5DkEtf6CXdFp0N0Em5UCwQpXMWke8IA0+l
github.com/hashicorp/go-multierror v1.1.1/go.mod h1:iw975J/qwKPdAO1clOe2L8331t/9/fmwbPZ6JB6eMoM=
github.com/hashicorp/hcl v1.0.0 h1:0Anlzjpi4vEasTeNFn2mLJgTSwt0+6sfsiTG8qcWGx4=
github.com/hashicorp/hcl v1.0.0/go.mod h1:E5yfLk+7swimpb2L/Alb/PJmXilQ/rhwaUYs4T20WEQ=
github.com/ice-blockchain/eskimo v1.401.0 h1:K13EuOLEJ+j60o9ZhA4na8Chb0Lms/9fU6Zqk4odphc=
github.com/ice-blockchain/eskimo v1.401.0/go.mod h1:JOmKPnBsnpJX2CgCl2Muj2Tl9PzbArEZ5Mf4KnS0xZk=
github.com/ice-blockchain/eskimo v1.402.0 h1:xPRG9IPFG7og+kvwKrmbt9o3TjuG5lmmB08nmqqWUG4=
github.com/ice-blockchain/eskimo v1.402.0/go.mod h1:2TNy4DTthRgPnLCzPp7BdlhopK1pcrVXrlYjcSiRIZw=
github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb h1:8TnFP3mc7O+tc44kv2e0/TpZKnEVUaKH+UstwfBwRkk=
github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb/go.mod h1:ZsQU7i3mxhgBBu43Oev7WPFbIjP4TniN/b1UPNGbrq8=
github.com/ice-blockchain/wintr v1.150.0 h1:ZzQrPKPVFYRpD3xgQ7/Cmrjz8eeu6UMQ9TvE+brVK0U=
github.com/ice-blockchain/wintr v1.150.0/go.mod h1:wrl5hbd6j/RUr79zglI/Q2QWht2bntf50uUt9hNWK1M=
github.com/ice-blockchain/wintr v1.151.0 h1:wYtEjKyrEHPIhisQG7didKTQW5li7WZEP8i4LHsGPhI=
github.com/ice-blockchain/wintr v1.151.0/go.mod h1:E3Cb/qkJJgQQBTrNwj63YMKHSWDvKssNrLZpZQK/Txs=
github.com/imroc/req/v3 v3.43.7 h1:dOcNb9n0X83N5/5/AOkiU+cLhzx8QFXjv5MhikazzQA=
github.com/imroc/req/v3 v3.43.7/go.mod h1:SQIz5iYop16MJxbo8ib+4LnostGCok8NQf8ToyQc2xA=
github.com/ip2location/ip2location-go/v9 v9.7.0 h1:ipwl67HOWcrw+6GOChkEXcreRQR37NabqBd2ayYa4Q0=
Expand Down

0 comments on commit 888a81a

Please sign in to comment.