]> git.immae.eu Git - perso/Immae/Config/Nix.git/blob - modules/private/websites/tools/games/codenames/greenapid.patch
Add codenames game
[perso/Immae/Config/Nix.git] / modules / private / websites / tools / games / codenames / greenapid.patch
1 diff --git a/cmd/greenapid/main.go b/cmd/greenapid/main.go
2 index 86499e9..1589323 100644
3 --- a/cmd/greenapid/main.go
4 +++ b/cmd/greenapid/main.go
5 @@ -1,6 +1,7 @@
6 package main
7
8 import (
9 + "net"
10 "net/http"
11
12 "github.com/jbowens/codenamesgreen/gameapi"
13 @@ -13,6 +14,12 @@ func main() {
14 }
15
16 h := gameapi.Handler(wordLists)
17 - err = http.ListenAndServe(":8080", h)
18 + server := &http.Server{Handler: h}
19 + ln, err := net.Listen("unix", "/run/codenamesgreen/socket.sock")
20 + if err != nil {
21 + panic(err)
22 + }
23 +
24 + err = server.Serve(ln)
25 panic(err)
26 }