diff --git a/serv_nginx/api_bb/bin/bb_api b/serv_nginx/api_bb/bin/bb_api new file mode 100644 index 0000000..263bba1 Binary files /dev/null and b/serv_nginx/api_bb/bin/bb_api differ diff --git a/serv_nginx/api_bb/internal/routes/routes.go b/serv_nginx/api_bb/internal/routes/routes.go index dd01dcb..9722434 100644 --- a/serv_nginx/api_bb/internal/routes/routes.go +++ b/serv_nginx/api_bb/internal/routes/routes.go @@ -14,7 +14,7 @@ import ( func SetupRouter(db *gorm.DB) http.Handler { r := chi.NewRouter() - + // Apply common middleware for _, m := range middleware.CommonMiddleware() { r.Use(m) @@ -22,26 +22,30 @@ func SetupRouter(db *gorm.DB) http.Handler { // Initialize repositories userRepo := repository.NewUserRepository(db) - + // Initialize services authService := service.NewAuthService(userRepo) - + // Initialize handlers healthHandler := handlers.NewHealthHandler() authHandler := handlers.NewAuthHandler(authService) - + // Health routes r.Mount("/api", healthHandler.Routes()) - + // API v1 routes r.Route("/api/v1", func(r chi.Router) { + // Add the new /check route + r.Get("/check", func(w http.ResponseWriter, r *http.Request) { + w.WriteHeader(http.StatusOK) + }) r.Mount("/auth", authHandler.Routes()) - + // Здесь будут добавлены другие маршруты: // r.Mount("/users", userHandler.Routes()) // r.Mount("/events", eventHandler.Routes()) // r.Mount("/reviews", reviewHandler.Routes()) }) - + return r -} \ No newline at end of file +} diff --git a/serv_nginx/api_bb/sqlite b/serv_nginx/api_bb/sqlite new file mode 100644 index 0000000..e69de29