summaryrefslogtreecommitdiff
path: root/cmd
diff options
context:
space:
mode:
authorSanto Cariotti <santo@dcariotti.me>2025-04-07 21:31:09 +0200
committerSanto Cariotti <santo@dcariotti.me>2025-04-07 21:31:09 +0200
commitf75ec8f8f5b3d0d75f752b26df1088e9d42d2634 (patch)
tree911a4bac5f8457c6029ec7e555f2081f98245a4f /cmd
parentd35c26ecc61103b4ba7d484acf76b6a969159518 (diff)
Join a game
Diffstat (limited to 'cmd')
-rw-r--r--cmd/api/main.go1
-rw-r--r--cmd/ui/main.go19
2 files changed, 20 insertions, 0 deletions
diff --git a/cmd/api/main.go b/cmd/api/main.go
index 67ebe07..b1f912f 100644
--- a/cmd/api/main.go
+++ b/cmd/api/main.go
@@ -19,6 +19,7 @@ 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("/enter-play", middleware.AuthMiddleware(http.HandlerFunc(handlers.EnterPlay))).Methods(http.MethodPost)
slog.Info("Serving on :8080")
handler := cors.AllowAll().Handler(r)
diff --git a/cmd/ui/main.go b/cmd/ui/main.go
new file mode 100644
index 0000000..4bdcce9
--- /dev/null
+++ b/cmd/ui/main.go
@@ -0,0 +1,19 @@
+package main
+
+import (
+ "log"
+
+ "github.com/boozec/rahanna/ui/views"
+ tea "github.com/charmbracelet/bubbletea"
+)
+
+func main() {
+ views.ClearScreen()
+
+ p := tea.NewProgram(views.NewRahannaModel(), tea.WithAltScreen())
+
+ if _, err := p.Run(); err != nil {
+ log.Fatal(err)
+ }
+ views.ClearScreen()
+}