forked from mtusi2026/mtusi2026lab2
feat: persist data in PostgreSQL and add Basic/Bearer sessions in Redis
This commit is contained in:
@@ -20,9 +20,11 @@ func New(h *handler.Handler) http.Handler {
|
||||
|
||||
r.Route("/api/v1", func(r chi.Router) {
|
||||
r.Post("/users", h.RegisterUser)
|
||||
r.Post("/auth/sessions", h.CreateSession)
|
||||
|
||||
r.Group(func(r chi.Router) {
|
||||
r.Use(h.Authenticate)
|
||||
r.Delete("/auth/sessions/current", h.DeleteSession)
|
||||
r.Get("/users/me", h.CurrentUser)
|
||||
r.Post("/chats", h.CreateChat)
|
||||
r.Get("/chats", h.ListChats)
|
||||
|
||||
Reference in New Issue
Block a user