basic main for testing

This commit is contained in:
Branden J Brown 2024-01-27 14:02:10 -06:00
parent 58e6e866b8
commit 57fb632446
3 changed files with 22 additions and 0 deletions

1
go.mod
View File

@ -3,6 +3,7 @@ module git.sunturtle.xyz/studio/shotgun
go 1.21.6
require (
github.com/go-chi/chi/v5 v5.0.11
github.com/google/uuid v1.5.0
nhooyr.io/websocket v1.8.10
)

2
go.sum
View File

@ -1,3 +1,5 @@
github.com/go-chi/chi/v5 v5.0.11 h1:BnpYbFZ3T3S1WMpD79r7R5ThWX40TaFB7L31Y8xqSwA=
github.com/go-chi/chi/v5 v5.0.11/go.mod h1:DslCQbL2OYiznFReuXYUmQ2hGd1aDpCnlMNITLSKoi8=
github.com/google/uuid v1.5.0 h1:1p67kYwdtXjb0gL0BPiP1Av9wiZPo5A8z2cWkTZ+eyU=
github.com/google/uuid v1.5.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo=
nhooyr.io/websocket v1.8.10 h1:mv4p+MnGrLDcPlBoWsvPP7XCzTYMXP9F9eIGoKbgx7Q=

19
main.go Normal file
View File

@ -0,0 +1,19 @@
package main
import (
"net/http"
"github.com/go-chi/chi/v5"
"git.sunturtle.xyz/studio/shotgun/lobby"
"git.sunturtle.xyz/studio/shotgun/serve"
)
func main() {
s := Server{
l: lobby.New(),
}
r := chi.NewRouter()
r.With(serve.WithPlayerID).Get("/queue", s.Queue)
http.ListenAndServe(":8080", r)
}