new file: main_dc/yalarba/api_yal/internal/handlers/allHandlers.go

modified:   main_dc/yalarba/api_yal/internal/router/router.go
add allhandlers.go file
This commit is contained in:
2026-03-04 06:54:02 +05:00
parent 6c6811ef01
commit 8b28a1ee01
2 changed files with 24 additions and 0 deletions
@@ -3,6 +3,8 @@ package router
import (
"api_yal/internal/config"
"api_yal/internal/logger"
"api_yal/internal/handlers"
"encoding/json"
"github.com/go-chi/chi/v5"
"gorm.io/gorm"
@@ -14,6 +16,7 @@ func SetupRouter(db *gorm.DB, config *config.Config) http.Handler {
zapLogger := logger.Get()
zapLogger.Info("Start setup routers")
r := chi.NewRouter()
h := handlers.NewAllHandler()
// Health check
r.Get("/health", func(w http.ResponseWriter, r *http.Request) {
@@ -22,6 +25,10 @@ func SetupRouter(db *gorm.DB, config *config.Config) http.Handler {
json.NewEncoder(w).Encode(map[string]string{"status": "healthy"})
})
r.Route("/auth", func(r chi.Router) {
r.Post("/register", h.AuthHandler().HandleAuth)
})
zapLogger.Info("End setup routers")
// Логируем все зарегистрированные маршруты