modified: internal/routes/routes.go
add to v1/check the check function
This commit is contained in:
@@ -30,15 +30,15 @@ func SetupRouter(db *gorm.DB) http.Handler {
|
|||||||
healthHandler := handlers.NewHealthHandler()
|
healthHandler := handlers.NewHealthHandler()
|
||||||
authHandler := handlers.NewAuthHandler(authService)
|
authHandler := handlers.NewAuthHandler(authService)
|
||||||
|
|
||||||
|
h := handlers.NewHealthHandler()
|
||||||
|
|
||||||
// Health routes
|
// Health routes
|
||||||
r.Mount("/", healthHandler.Routes())
|
r.Mount("/", healthHandler.Routes())
|
||||||
|
|
||||||
// API v1 routes
|
// API v1 routes
|
||||||
r.Route("/v1", func(r chi.Router) {
|
r.Route("/v1", func(r chi.Router) {
|
||||||
// Add the new /check route
|
// Add the new /check route
|
||||||
r.Get("/check", func(w http.ResponseWriter, r *http.Request) {
|
r.Get("/check", h.Check)
|
||||||
w.WriteHeader(http.StatusOK)
|
|
||||||
})
|
|
||||||
r.Mount("/auth", authHandler.Routes())
|
r.Mount("/auth", authHandler.Routes())
|
||||||
|
|
||||||
// Здесь будут добавлены другие маршруты:
|
// Здесь будут добавлены другие маршруты:
|
||||||
|
|||||||
Reference in New Issue
Block a user