Skip to content

Commit 3a8e541

Browse files
committed
Add a route to the JSON licenses list
1 parent e24de69 commit 3a8e541

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

atr/routes/root.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,14 +17,17 @@
1717

1818
"""root.py"""
1919

20+
import pathlib
2021
from typing import Final
2122

23+
import aiofiles
2224
import asfquart.session
2325
import htpy
2426
import quart.wrappers.response as response
2527
import sqlalchemy.orm as orm
2628
import sqlmodel
2729

30+
import atr.config as config
2831
import atr.db as db
2932
import atr.models.sql as sql
3033
import atr.route as route
@@ -145,6 +148,14 @@ def sort_key(item: dict) -> str:
145148
return await template.render("index-public.html")
146149

147150

151+
@route.public("/miscellaneous/resolved.json")
152+
async def resolved_json(session: route.CommitterSession | None) -> response.Response:
153+
json_path = pathlib.Path(config.get().PROJECT_ROOT) / "atr" / "static" / "json" / "resolved.json"
154+
async with aiofiles.open(json_path) as f:
155+
content = await f.read()
156+
return response.Response(content, mimetype="application/json")
157+
158+
148159
@route.public("/policies")
149160
async def policies(session: route.CommitterSession | None) -> str:
150161
return await template.blank("Policies", content=_POLICIES)

0 commit comments

Comments
 (0)