WebHost: add pretty print version of datapackage for human eyes

This commit is contained in:
Fabian Dill 2022-01-07 03:32:51 +01:00
parent 969ea5e6ee
commit f6197d0a8d
2 changed files with 10 additions and 0 deletions

View File

@ -193,6 +193,15 @@ def discord():
return redirect("https://discord.gg/archipelago")
@app.route('/datapackage')
@cache.cached()
def get_datapackge():
"""A pretty print version of /api/datapackage"""
from worlds import network_data_package
import json
return Response(json.dumps(network_data_package, indent=4), mimetype="text/plain")
from WebHostLib.customserver import run_server_process
from . import tracker, upload, landing, check, generate, downloads, api # to trigger app routing picking up on it

View File

@ -31,6 +31,7 @@ def get_datapackge():
from worlds import network_data_package
return network_data_package
@api_endpoints.route('/datapackage_version')
@cache.cached()
def get_datapackge_versions():