Explorar o código

Response bij aanmaken game

Harry de Boer %!s(int64=10) %!d(string=hai) anos
pai
achega
dbe75921a2
Modificáronse 1 ficheiros con 2 adicións e 0 borrados
  1. 2 0
      main.go

+ 2 - 0
main.go

@@ -59,6 +59,8 @@ func createGame(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {
 
 	currentGames.AddGame(game)
 	w.WriteHeader(http.StatusCreated)
+	e := json.NewEncoder(w)
+	e.Encode(game)
 }
 
 func joinGame(w http.ResponseWriter, r *http.Request, ps httprouter.Params) {