Skip to content

Commit

Permalink
fixed swagger.json url
Browse files Browse the repository at this point in the history
* the url to the swagger.json uses now the correct ip address.

see #225
  • Loading branch information
Bernhard B committed Mar 6, 2022
1 parent f411b55 commit bede4bc
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 5 deletions.
2 changes: 1 addition & 1 deletion src/docs/docs.go
Original file line number Diff line number Diff line change
Expand Up @@ -1523,7 +1523,7 @@ type swaggerInfo struct {
// SwaggerInfo holds exported Swagger Info so clients can modify it
var SwaggerInfo = swaggerInfo{
Version: "1.0",
Host: "127.0.0.1:8080",
Host: "",
BasePath: "/",
Schemes: []string{},
Title: "Signal Cli REST API",
Expand Down
1 change: 0 additions & 1 deletion src/docs/swagger.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@
"license": {},
"version": "1.0"
},
"host": "127.0.0.1:8080",
"basePath": "/",
"paths": {
"/v1/about": {
Expand Down
1 change: 0 additions & 1 deletion src/docs/swagger.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,6 @@ definitions:
status:
type: string
type: object
host: 127.0.0.1:8080
info:
contact: {}
description: This is the Signal Cli REST API documentation.
Expand Down
3 changes: 1 addition & 2 deletions src/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ import (
// @tag.name Search
// @tag.description Search the Signal Service.

// @host 127.0.0.1:8080
// @BasePath /
func main() {
signalCliConfig := flag.String("signal-cli-config", "/home/.local/share/signal-cli/", "Config directory where signal-cli config is stored")
Expand Down Expand Up @@ -238,7 +237,7 @@ func main() {
}
}

swaggerUrl := ginSwagger.URL("http://127.0.0.1:" + string(port) + "/swagger/doc.json")
swaggerUrl := ginSwagger.URL("http://" + swaggerIp + ":" + string(port) + "/swagger/doc.json")
router.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler, swaggerUrl))

autoReceiveSchedule := utils.GetEnv("AUTO_RECEIVE_SCHEDULE", "")
Expand Down

0 comments on commit bede4bc

Please sign in to comment.