Files
tp/main_dc/yalarba/api_yal/internal/router/router.go
T
valitovgaziz 06d3dbd8b7 modified: main_dc/yalarba/api_yal/cmd/main.go
modified:   main_dc/yalarba/api_yal/internal/router/router.go
set router
2026-02-25 12:34:32 +05:00

25 lines
508 B
Go

package router
import (
"api_yal/internal/config"
"api_yal/internal/logger"
"encoding/json"
"github.com/go-chi/chi"
)
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_yal", func(w http.ResponseWriter, r *http.Request) {
w.Header().Set("Content-Type", "application/json")
json.NewEncoder(w).Encode(map[string]string{"status": "healthy"})
})
return r
}