modified: serv_nginx/api_bb/internal/routes/routes.go
change router path rounting
This commit is contained in:
@@ -56,9 +56,9 @@ func SetupRouter(db *gorm.DB, config *config.Config) http.Handler {
|
|||||||
r.Use(middleware.AuthMiddleware(jwtService, userRepo))
|
r.Use(middleware.AuthMiddleware(jwtService, userRepo))
|
||||||
r.Use(middleware.RequireAuth)
|
r.Use(middleware.RequireAuth)
|
||||||
|
|
||||||
r.Mount("/", allHandler.UserHandler().Routes())
|
|
||||||
|
|
||||||
r.Mount("/avatars", allHandler.AvatarHandler().Routes())
|
r.Mount("/avatars", allHandler.AvatarHandler().Routes())
|
||||||
|
r.Mount("/", allHandler.UserHandler().Routes())
|
||||||
|
|
||||||
// Здесь будут другие защищенные маршруты пользователя
|
// Здесь будут другие защищенные маршруты пользователя
|
||||||
})
|
})
|
||||||
@@ -84,7 +84,7 @@ func SetupRouter(db *gorm.DB, config *config.Config) http.Handler {
|
|||||||
|
|
||||||
r.Post("/{id}/comments", allHandler.NewsHandler().CreateComment)
|
r.Post("/{id}/comments", allHandler.NewsHandler().CreateComment)
|
||||||
r.Delete("/comments/{commentId}", allHandler.NewsHandler().DeleteComment)
|
r.Delete("/comments/{commentId}", allHandler.NewsHandler().DeleteComment)
|
||||||
|
|
||||||
r.Get("/check", allHandler.HealthHandler().Check)
|
r.Get("/check", allHandler.HealthHandler().Check)
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
|
|||||||
Reference in New Issue
Block a user