More UX improvements.
This commit is contained in:
@@ -51,9 +51,14 @@ func (s *Server) Handler() http.Handler {
|
||||
return mux
|
||||
}
|
||||
|
||||
// handleCatalog returns every card in the game, for the debug panel.
|
||||
func (s *Server) handleCatalog(w http.ResponseWriter, _ *http.Request) {
|
||||
writeJSON(w, game.Catalog())
|
||||
// handleCatalog returns every card in a pack (?pack=…, default Turtle), for the
|
||||
// debug panel. Unknown packs fall back to the default.
|
||||
func (s *Server) handleCatalog(w http.ResponseWriter, req *http.Request) {
|
||||
pack := req.URL.Query().Get("pack")
|
||||
if pack == "" {
|
||||
pack = game.DefaultPack
|
||||
}
|
||||
writeJSON(w, game.CatalogForPack(pack))
|
||||
}
|
||||
|
||||
// room is one live game plus its connections.
|
||||
|
||||
Reference in New Issue
Block a user