diff options
author | Santo Cariotti <santo@dcariotti.me> | 2025-04-08 23:40:22 +0200 |
---|---|---|
committer | Santo Cariotti <santo@dcariotti.me> | 2025-04-08 23:40:22 +0200 |
commit | be8df3cb06cfb9aa1228b206e9896bbd7dfa8d82 (patch) | |
tree | 087c8f3f26cf7f33736552bcade09d7c13bb4be7 /cmd | |
parent | d8fa18ef21c10040cd2b06f39df331c7407f23fe (diff) |
Add endpoint to get play
Diffstat (limited to 'cmd')
-rw-r--r-- | cmd/api/main.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/cmd/api/main.go b/cmd/api/main.go index 1fcd4d1..1ce83c9 100644 --- a/cmd/api/main.go +++ b/cmd/api/main.go @@ -20,6 +20,8 @@ func main() { r.HandleFunc("/auth/register", handlers.RegisterUser).Methods(http.MethodPost) r.HandleFunc("/auth/login", handlers.LoginUser).Methods(http.MethodPost) r.Handle("/play", middleware.AuthMiddleware(http.HandlerFunc(handlers.NewPlay))).Methods(http.MethodPost) + r.Handle("/play", middleware.AuthMiddleware(http.HandlerFunc(handlers.AllPlay))).Methods(http.MethodGet) + r.Handle("/play/{id}", middleware.AuthMiddleware(http.HandlerFunc(handlers.GetGameId))).Methods(http.MethodGet) r.Handle("/enter-game", middleware.AuthMiddleware(http.HandlerFunc(handlers.EnterGame))).Methods(http.MethodPost) log.Info("Serving on :8080") |