yats.git

commit a9081b0b6e4f9bbf46e339fa88478ded8325444a

Author: Paolo Lulli <paolo@lulli.net>

Off Swagger by default

 server/config/config.go | 1 +
 server/service-rest.go | 4 +++-


diff --git a/server/config/config.go b/server/config/config.go
index eb79fec7366c8746a75ae7184a2a46688b960c34..6c0529f22a0c7da843382e8a86b3a0152eb96f43 100644
--- a/server/config/config.go
+++ b/server/config/config.go
@@ -56,6 +56,7 @@ 	TlsCA          string `json:"tlsCA"`
 
 	LogFile       string `json:"logFile"`
 	GrafanaActive string `json:"grafanaActive"`
+	OpenApiActive string `json:"openapiActive"`
 }
 
 func GetConfig(fileName string) Configuration {




diff --git a/server/service-rest.go b/server/service-rest.go
index 06a6fc9560a0768f3ea5720ea8934b994b2f4b81..3b01fe41a7cb50dc7d4600609a706d86018b0798 100644
--- a/server/service-rest.go
+++ b/server/service-rest.go
@@ -39,7 +39,9 @@ 	router.GET("/event/:from", rest.GetEventsFrom(cfg))
 
 	router.POST("/position", rest.WritePosition(cfg))
 
-	enableSwaggerEndpoint(router)
+	if cfg.OpenApiActive == "true" {
+		enableSwaggerEndpoint(router)
+	}
 
 	if cfg.GrafanaActive == "true" {
 		enableGrafanaEndpoint(router)