modified: serv_nginx/api_bb/internal/handlers/auth.go

modified:   serv_nginx/api_bb/internal/handlers/avatar.go
	modified:   serv_nginx/api_bb/internal/handlers/health.go
	modified:   serv_nginx/api_bb/internal/handlers/user.go
	modified:   serv_nginx/api_bb/internal/routes/routes.go
	deleted:    serv_nginx/bbvue/src/stores/counter.js
	modified:   serv_nginx/bbvue/src/views/Profile.vue
update chi to last, moove the routing from handlers to router.go
This commit is contained in:
2025-10-19 05:26:54 +05:00
parent c358ba01c9
commit ed8f0943c3
7 changed files with 23 additions and 72 deletions
@@ -14,7 +14,6 @@ import (
"api_bb/pkg/logger"
"api_bb/pkg/utils"
"github.com/go-chi/chi/v5"
"go.uber.org/zap"
)
@@ -32,21 +31,6 @@ func NewAuthHandler(authService service.AuthService, jwtService service.JWTServi
}
}
func (h *AuthHandler) Routes() chi.Router {
r := chi.NewRouter()
// Обработка OPTIONS запросов для CORS
r.Options("/register", h.handleOptions)
r.Options("/login", h.handleOptions)
r.Options("/logout", h.handleOptions)
r.Post("/register", h.Register)
r.Post("/login", h.Login)
r.Post("/logout", h.Logout)
return r
}
// Обработчик для OPTIONS запросов
func (h *AuthHandler) handleOptions(w http.ResponseWriter, r *http.Request) {
w.WriteHeader(http.StatusOK)