aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend/main.go
diff options
context:
space:
mode:
Diffstat (limited to 'backend/main.go')
-rw-r--r--backend/main.go12
1 files changed, 7 insertions, 5 deletions
diff --git a/backend/main.go b/backend/main.go
index 8042674..91caa73 100644
--- a/backend/main.go
+++ b/backend/main.go
@@ -64,20 +64,22 @@ func main() {
api.NewJWTMiddleware(),
}))
- gameHubs := game.NewGameHubs()
- err = gameHubs.RestoreFromDB(ctx, queries)
+ gameHubs := game.NewGameHubs(queries)
+ err = gameHubs.RestoreFromDB(ctx)
if err != nil {
log.Fatalf("Error restoring game hubs from db %v", err)
}
defer gameHubs.Close()
sockGroup := e.Group("/sock")
sockHandler := gameHubs.SockHandler()
- sockGroup.GET("/golf/:gameId/watch", func(c echo.Context) error {
- return sockHandler.HandleSockGolfWatch(c)
- })
sockGroup.GET("/golf/:gameId/play", func(c echo.Context) error {
return sockHandler.HandleSockGolfPlay(c)
})
+ sockGroup.GET("/golf/:gameId/watch", func(c echo.Context) error {
+ return sockHandler.HandleSockGolfWatch(c)
+ })
+
+ gameHubs.Run()
if err := e.Start(":80"); err != http.ErrServerClosed {
log.Fatal(err)