methods for creating and getting users

This commit is contained in:
2025-03-27 21:07:33 -04:00
parent 9d7ad260f2
commit 25ee1d3299
3 changed files with 81 additions and 5 deletions

View File

@@ -47,6 +47,14 @@ func Start() {
r.Post("/new", NewMessage)
})
r.Route("/users", func(r chi.Router) {
r.Route("/{userID}", func(r chi.Router) {
r.Use(UserCtx) // Load user
r.Get("/", GetUser)
})
r.Post("/new", NewUser)
})
if *routes {
fmt.Println(docgen.MarkdownRoutesDoc(r, docgen.MarkdownOpts{
ProjectPath: "git.dubyatp.xyz/chat-api-server",