Draft: poop
This commit is contained in:
24
workflows/gameServer.go
Normal file
24
workflows/gameServer.go
Normal file
@@ -0,0 +1,24 @@
|
||||
package workflows
|
||||
|
||||
import (
|
||||
"inp2025/handlers/game"
|
||||
"inp2025/middlewares"
|
||||
"inp2025/tcp"
|
||||
)
|
||||
|
||||
func GameServer() *tcp.Router {
|
||||
router := tcp.NewRouter().
|
||||
Use(middlewares.ErrorHandler).
|
||||
Use(middlewares.AccessLog)
|
||||
|
||||
handlers := game.NewHandlers()
|
||||
|
||||
// before start
|
||||
router.POST("/ready", handlers.PostReady)
|
||||
|
||||
// game start
|
||||
router.POST("/move", handlers.PostMove)
|
||||
router.SOCKET("/state", handlers.SocketState)
|
||||
|
||||
return router
|
||||
}
|
||||
Reference in New Issue
Block a user