summaryrefslogtreecommitdiff
path: root/cmd/api
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2025-04-08 23:40:22 +0200
committerSanto Cariotti <santo@dcariotti.me>2025-04-08 23:40:22 +0200
commitbe8df3cb06cfb9aa1228b206e9896bbd7dfa8d82 (patch)
tree087c8f3f26cf7f33736552bcade09d7c13bb4be7 /cmd/api
parentd8fa18ef21c10040cd2b06f39df331c7407f23fe (diff)
Add endpoint to get play
Diffstat (limited to 'cmd/api')
-rw-r--r--cmd/api/main.go2
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")