aboutsummaryrefslogtreecommitdiff
path: root/modules/private/websites/tools/games/codenames/greenapid.patch
blob: a8f670aaa5102429423fab76ba01919b29e6361c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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)
 }