X-Git-Url: https://git.immae.eu/?a=blobdiff_plain;f=modules%2Fprivate%2Fwebsites%2Ftools%2Fgames%2Fcodenames%2Fgreenapid.patch;fp=modules%2Fprivate%2Fwebsites%2Ftools%2Fgames%2Fcodenames%2Fgreenapid.patch;h=a8f670aaa5102429423fab76ba01919b29e6361c;hb=de6002a102eb825678bebe12b13a119263e59eef;hp=0000000000000000000000000000000000000000;hpb=9c08c3bc093d3d4547214daf057051e7384581e9;p=perso%2FImmae%2FConfig%2FNix.git diff --git a/modules/private/websites/tools/games/codenames/greenapid.patch b/modules/private/websites/tools/games/codenames/greenapid.patch new file mode 100644 index 0000000..a8f670a --- /dev/null +++ b/modules/private/websites/tools/games/codenames/greenapid.patch @@ -0,0 +1,26 @@ +diff --git a/cmd/greenapid/main.go b/cmd/greenapid/main.go +index 86499e9..1589323 100644 +--- a/cmd/greenapid/main.go ++++ b/cmd/greenapid/main.go +@@ -1,6 +1,7 @@ + package main + + import ( ++ "net" + "net/http" + + "github.com/jbowens/codenamesgreen/gameapi" +@@ -13,6 +14,12 @@ func main() { + } + + h := gameapi.Handler(wordLists) +- err = http.ListenAndServe(":8080", h) ++ server := &http.Server{Handler: h} ++ ln, err := net.Listen("unix", "/run/codenamesgreen/socket.sock") ++ if err != nil { ++ panic(err) ++ } ++ ++ err = server.Serve(ln) + panic(err) + }