Add a hashkey view similar to the player_info JSON one.
[xonotic/xonstat.git] / xonstat / __init__.py
index e7bfba387aeb46b69998a113cf85ded34a0c93a3..5ee0e4641684e92cbab1c16049903f34dbb7304e 100644 (file)
@@ -9,7 +9,7 @@ def main(global_config, **settings):
     """ This function returns a Pyramid WSGI application.
     """
     # setup the database engine
-    engine = engine_from_config(settings, 'sqlalchemy.')
+    engine = engine_from_config(settings, 'sqlalchemy.', pool_size=5)
     sqlahelper.add_engine(engine)
 
     # initialize database structures
@@ -40,6 +40,9 @@ def main(global_config, **settings):
     config.add_view(player_info,      route_name="player_info",      renderer="player_info.mako")
     config.add_view(player_info_json, route_name="player_info_json", renderer="jsonp")
 
+    config.add_route("player_hashkey_info_json", "/hashkey/{hashkey}")
+    config.add_view(player_hashkey_info_json, route_name="player_hashkey_info_json", renderer="jsonp")
+
     config.add_route("player_accuracy",      "/player/{id:\d+}/accuracy")
     config.add_route("player_accuracy_json", "/player/{id:\d+}/accuracy.json")
     config.add_view(player_accuracy_json, route_name="player_accuracy",      renderer="jsonp")