forked from ebhomengo/niki
				
			fix(delivery): fix swagger sending request to the wrong host and port
This commit is contained in:
		
							parent
							
								
									fab3cfa7d4
								
							
						
					
					
						commit
						ccc56ddb03
					
				| 
						 | 
					@ -67,7 +67,7 @@ func (s Server) Serve() {
 | 
				
			||||||
func (s Server) RegisterRoutes() {
 | 
					func (s Server) RegisterRoutes() {
 | 
				
			||||||
	s.Router.Use(middleware.RequestID())
 | 
						s.Router.Use(middleware.RequestID())
 | 
				
			||||||
	s.Router.Use(middleware.Recover())
 | 
						s.Router.Use(middleware.Recover())
 | 
				
			||||||
	registerSwagger(s.Router, s.config)
 | 
						registerSwagger(s.Router)
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	// Routes
 | 
						// Routes
 | 
				
			||||||
	s.Router.GET("/health-check", s.healthCheck)
 | 
						s.Router.GET("/health-check", s.healthCheck)
 | 
				
			||||||
| 
						 | 
					@ -81,12 +81,11 @@ func (s Server) RegisterRoutes() {
 | 
				
			||||||
	s.agentKindBoxHandler.SetRoutes(s.Router)
 | 
						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
 | 
						// TODO: move this to a better place and make it more dynamic and configurable
 | 
				
			||||||
	docs.SwaggerInfo.Title = "NIKI API"
 | 
						docs.SwaggerInfo.Title = "NIKI API"
 | 
				
			||||||
	docs.SwaggerInfo.Description = "This is the API documentation for the NIKI project"
 | 
						docs.SwaggerInfo.Description = "This is the API documentation for the NIKI project"
 | 
				
			||||||
	docs.SwaggerInfo.Version = "1.0.0"
 | 
						docs.SwaggerInfo.Version = "1.0.0"
 | 
				
			||||||
	docs.SwaggerInfo.Host = fmt.Sprintf("localhost:%d", c.HTTPServer.Port)
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
	s.GET("/swagger/*any", echoSwagger.WrapHandler)
 | 
						s.GET("/swagger/*any", echoSwagger.WrapHandler)
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in New Issue