Enable JSON for the games view as well. json-suffix
authorAnt Zucaro <azucaro@gmail.com>
Mon, 24 Dec 2018 16:18:26 +0000 (11:18 -0500)
committerAnt Zucaro <azucaro@gmail.com>
Mon, 24 Dec 2018 16:18:26 +0000 (11:18 -0500)
xonstat/__init__.py

index 54b0ffc..8646c02 100644 (file)
@@ -141,7 +141,10 @@ def main(global_config, **settings):
     config.add_view(game_info_json, route_name="game_info_json", renderer="jsonp")
 
     config.add_route("game_index", "/games")
-    config.add_view(game_finder, route_name="game_index", renderer="game_finder.mako")
+    config.add_view(game_finder, route_name="game_index", accept="text/html",
+                    renderer="game_finder.mako")
+    config.add_view(game_finder_json, route_name="game_index", accept="application/json",
+                    renderer="json")
 
     config.add_route("game_index_json", "/games.json")
     config.add_view(game_finder_json, route_name="game_index_json", renderer="jsonp")