]> git.xonotic.org Git - xonotic/xonstat.git/blobdiff - xonstat/__init__.py
More server refactoring...still not sure if this is the right way to go.
[xonotic/xonstat.git] / xonstat / __init__.py
index b925989c2be691d0e948cebcf16d769f5b978ae4..86024a0bdd6d0cf78e483f7e6d77b3f7c1cf4f76 100644 (file)
@@ -150,6 +150,33 @@ def main(global_config, **settings):
         accept="text/json"
     )
 
+    config.add_route("server_top_maps", "/server/{id:\d+}/topmaps")
+    config.add_view(
+        view=ServerTopMaps,
+        route_name="server_top_maps",
+        attr="json",
+        renderer="json",
+        accept="text/json"
+    )
+
+    config.add_route("server_top_players", "/server/{id:\d+}/topplayers")
+    config.add_view(
+        view=ServerTopPlayers,
+        route_name="server_top_players",
+        attr="json",
+        renderer="json",
+        accept="text/json"
+    )
+
+    config.add_route("server_top_scorers", "/server/{id:\d+}/topscorers")
+    config.add_view(
+        view=ServerTopScorers,
+        route_name="server_top_scorers",
+        attr="json",
+        renderer="json",
+        accept="text/json"
+    )
+
     config.add_route("server_info", "/server/{id:\d+}")
     config.add_view(
         view=ServerInfo,
@@ -162,7 +189,7 @@ def main(global_config, **settings):
         view=ServerInfo,
         route_name="server_info",
         attr="json",
-        renderer="server_info.mako",
+        renderer="json",
         accept="text/json"
     )