diff options
| author | nsfisis <nsfisis@gmail.com> | 2024-07-28 20:09:09 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2024-07-29 02:32:26 +0900 |
| commit | daaf81ae931654e20f882fbc6bbc4a02cbfc0273 (patch) | |
| tree | 2d0eb7c9f40e28a4295dc1065c80d5d891a8995a /backend/main.go | |
| parent | 0b90018afbd438d61db7b41e5c3ea41cbb563bfe (diff) | |
| download | iosdc-japan-2024-albatross-daaf81ae931654e20f882fbc6bbc4a02cbfc0273.tar.gz iosdc-japan-2024-albatross-daaf81ae931654e20f882fbc6bbc4a02cbfc0273.tar.zst iosdc-japan-2024-albatross-daaf81ae931654e20f882fbc6bbc4a02cbfc0273.zip | |
feat(backend): partially implement gaming
Diffstat (limited to 'backend/main.go')
| -rw-r--r-- | backend/main.go | 12 |
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) |
