from xonstat.views import *
from xonstat.security import *
+
def main(global_config, **settings):
""" This function returns a Pyramid WSGI application.
"""
config.add_view(game_finder_json, route_name="game_index_json", renderer="jsonp")
# SERVER ROUTES
- config.add_route("server_index", "/servers")
- config.add_view(server_index, route_name="server_index", renderer="server_index.mako")
-
- config.add_route("server_index_json", "/servers.json")
- config.add_view(server_index_json, route_name="server_index_json", renderer="jsonp")
+ config.add_route("server_index", "/servers")
+ config.add_view(
+ view=ServerIndex,
+ route_name="server_index",
+ attr="html",
+ renderer="server_index.mako",
+ accept="text/html"
+ )
+ config.add_view(
+ view=ServerIndex,
+ route_name="server_index",
+ attr="json",
+ renderer="json",
+ accept="text/json"
+ )
config.add_route("server_info", "/server/{id:\d+}")
config.add_view(server_info, route_name="server_info", renderer="server_info.mako")