modified: main_dc/docker-compose.yml
modified: main_dc/yalarba/api_yal/internal/router/router.go add depends on db to api_yal service add auth path for check healt
This commit is contained in:
@@ -10,18 +10,22 @@ import (
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
|
||||
func SetupRouter(db *gorm.DB, config *config.Config) http.Handler {
|
||||
|
||||
zapLogger := logger.Get()
|
||||
zapLogger.Info("Start setup routers")
|
||||
r := chi.NewRouter()
|
||||
|
||||
|
||||
// Health check
|
||||
r.Get("/health", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(map[string]string{"status": "healthy"})
|
||||
})
|
||||
|
||||
r.Get("/auth", func(w http.ResponseWriter, r *http.Request) {
|
||||
w.Header().Set("Content-Type", "application/json")
|
||||
json.NewEncoder(w).Encode(map[string]string{"status": "ok"})
|
||||
})
|
||||
|
||||
return r
|
||||
}
|
||||
Reference in New Issue
Block a user