code refactor, added contact post route
This commit is contained in:
@@ -15,12 +15,13 @@ func SetupRoutes(app *fiber.App) {
|
||||
chat := api.Group("/chat", middleware.Protected(), logger.New())
|
||||
|
||||
// Auth group
|
||||
auth := api.Group("/auth", middleware.Protected(), handlers.ValidateToken)
|
||||
auth := api.Group("/auth", logger.New())
|
||||
auth.Post("/signup", handlers.Signup)
|
||||
auth.Post("/login", handlers.Login)
|
||||
auth.Get("/validate", handlers.ValidateToken)
|
||||
auth.Get("/validate", middleware.Protected(), handlers.ValidateToken)
|
||||
|
||||
// Contacts group
|
||||
contacts := chat.Group("/contacts", middleware.Protected(), logger.New())
|
||||
contacts.Delete("/:contact_id/:conversation_id", handlers.DeleteContact)
|
||||
contacts.Post("/:contact_username", handlers.InsertContact)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user