From 523b90b604b029d0d5d3e7f8ca8159fae2e43c7a Mon Sep 17 00:00:00 2001 From: qowevisa Date: Sat, 3 Aug 2024 13:40:17 +0300 Subject: [PATCH] Add categories routes --- cmd/http-server/main.go | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/cmd/http-server/main.go b/cmd/http-server/main.go index 6031bf2..451f35e 100644 --- a/cmd/http-server/main.go +++ b/cmd/http-server/main.go @@ -44,6 +44,13 @@ func main() { cardsRoutes.PUT("/edit/:id", handlers.CardPutId) cardsRoutes.DELETE("/delete/:id", handlers.CardDeleteId) } + categoriesRoutes := api.Group("/category", middleware.AuthMiddleware()) + { + categoriesRoutes.POST("/add", handlers.CategoryAdd) + categoriesRoutes.GET("/:id", handlers.CategoryGetId) + categoriesRoutes.PUT("/edit/:id", handlers.CategoryPutId) + categoriesRoutes.DELETE("/delete/:id", handlers.CategoryDeleteId) + } } r.GET("/swagger/*any", ginSwagger.WrapHandler(swaggerFiles.Handler))