Skip to content

Commit

Permalink
fix base path on swagger to be replaced on nginx
Browse files Browse the repository at this point in the history
  • Loading branch information
ice-cronus committed Aug 30, 2024
1 parent 1b9589b commit 170f659
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 13 deletions.
2 changes: 1 addition & 1 deletion application.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ cmd/freezer:
host: localhost:2443
version: local
defaultEndpointTimeout: 30s
tenant: sunwaves
httpServer:
port: 2443
certPath: cmd/freezer/.testdata/localhost.crt
Expand All @@ -35,6 +34,7 @@ cmd/freezer-refrigerant:
host: localhost:3443
version: local
defaultEndpointTimeout: 30s
#tenant: sunwaves
httpServer:
port: 3443
certPath: cmd/freezer-refrigerant/.testdata/localhost.crt
Expand Down
7 changes: 4 additions & 3 deletions cmd/freezer-refrigerant/freezer_refrigerant.go
Original file line number Diff line number Diff line change
Expand Up @@ -32,11 +32,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
6 changes: 3 additions & 3 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ require (
github.com/ethereum/go-ethereum v1.14.8
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/eskimo v1.402.0
github.com/ice-blockchain/go-tarantool-client v0.0.0-20230327200757-4fc71fa3f7bb
github.com/ice-blockchain/wintr v1.150.0
github.com/ice-blockchain/wintr v1.151.0
github.com/imroc/req/v3 v3.43.7
github.com/oklog/ulid/v2 v2.1.0
github.com/pkg/errors v0.9.1
Expand Down Expand Up @@ -108,7 +108,7 @@ require (
github.com/golang/groupcache v0.0.0-20210331224755-41bb18bfe9da // indirect
github.com/golang/protobuf v1.5.4 // indirect
github.com/golang/snappy v0.0.5-0.20231225225746-43d5d4cd4e0e // indirect
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 // indirect
github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25 // indirect
github.com/google/s2a-go v0.1.8 // indirect
github.com/google/uuid v1.6.0 // indirect
github.com/googleapis/enterprise-certificate-proxy v0.3.3 // indirect
Expand Down
12 changes: 6 additions & 6 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -265,8 +265,8 @@ github.com/google/gofuzz v1.2.0/go.mod h1:dBl0BpW6vV/+mYPU4Po3pmUjxk6FQPldtuIdl/
github.com/google/martian/v3 v3.3.3 h1:DIhPTQrbPkgs2yJYdXU/eNACCG5DVQjySNRNlflZ9Fc=
github.com/google/martian/v3 v3.3.3/go.mod h1:iEPrYcgCF7jA9OtScMFQyAlZZ4YXTKEtJ1E6RWzmBA0=
github.com/google/pprof v0.0.0-20210407192527-94a9f03dee38/go.mod h1:kpwsk12EmLew5upagYY7GY0pfYCcupk39gWOCRROcvE=
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5 h1:5iH8iuqE5apketRbSFBy+X1V0o+l+8NF1avt4HWl7cA=
github.com/google/pprof v0.0.0-20240827171923-fa2c70bbbfe5/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25 h1:sEDPKUw6iPjczdu33njxFjO6tYa9bfc0z/QyB/zSsBw=
github.com/google/pprof v0.0.0-20240829160300-da1f7e9f2b25/go.mod h1:vavhavw2zAxS5dIdcRluK6cSGGPlZynqzFM8NdvU144=
github.com/google/s2a-go v0.1.8 h1:zZDs9gcbt9ZPLV0ndSyQk6Kacx2g/X+SKYovpnz3SMM=
github.com/google/s2a-go v0.1.8/go.mod h1:6iNWHTpQ+nfNRN5E00MSdfDwVesa8hhS32PhPO8deJA=
github.com/google/subcommands v1.2.0/go.mod h1:ZjhPrFU+Olkh9WazFPsl27BQ4UPiG37m3yTrtFlrHVk=
Expand Down Expand Up @@ -302,12 +302,12 @@ github.com/hpcloud/tail v1.0.0/go.mod h1:ab1qPbhIpdTxEkNHXyeSf5vhxWSCs/tWer42PpO
github.com/huin/goupnp v1.3.0 h1:UvLUlWDNpoUdYzb2TCn+MuTWtcjXKSza2n6CBdQ0xXc=
github.com/huin/goupnp v1.3.0/go.mod h1:gnGPsThkYa7bFi/KWmEysQRf48l2dvR5bxr2OFckNX8=
github.com/ianlancetaylor/demangle v0.0.0-20200824232613-28f6c0f3b639/go.mod h1:aSSvb/t6k1mPoxDqO4vJh6VOCGPwU4O0C2/Eqndh1Sc=
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 170f659

Please sign in to comment.