From ccc56ddb0371caf77291dfbc9a58650ee006f848 Mon Sep 17 00:00:00 2001 From: Ruhollah Date: Wed, 4 Sep 2024 17:32:52 +0330 Subject: [PATCH] fix(delivery): fix swagger sending request to the wrong host and port --- delivery/http_server/server.go | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/delivery/http_server/server.go b/delivery/http_server/server.go index eb77c29..e015501 100644 --- a/delivery/http_server/server.go +++ b/delivery/http_server/server.go @@ -67,7 +67,7 @@ func (s Server) Serve() { func (s Server) RegisterRoutes() { s.Router.Use(middleware.RequestID()) s.Router.Use(middleware.Recover()) - registerSwagger(s.Router, s.config) + registerSwagger(s.Router) // Routes s.Router.GET("/health-check", s.healthCheck) @@ -81,12 +81,11 @@ func (s Server) RegisterRoutes() { s.agentKindBoxHandler.SetRoutes(s.Router) } -func registerSwagger(s *echo.Echo, c config.Config) { +func registerSwagger(s *echo.Echo) { // TODO: move this to a better place and make it more dynamic and configurable docs.SwaggerInfo.Title = "NIKI API" docs.SwaggerInfo.Description = "This is the API documentation for the NIKI project" docs.SwaggerInfo.Version = "1.0.0" - docs.SwaggerInfo.Host = fmt.Sprintf("localhost:%d", c.HTTPServer.Port) s.GET("/swagger/*any", echoSwagger.WrapHandler) }