Filter and tokens update
This commit is contained in:
@@ -82,6 +82,14 @@ app.include_router(cards_router, dependencies=[Depends(auth)])
|
||||
app.include_router(public_router) # no auth — TTS app fetches card images directly
|
||||
|
||||
|
||||
@app.get("/decks/{slug}/tts.json")
|
||||
async def tts_json(slug: str):
|
||||
path = OUTPUTS / slug / "deck.tts.json"
|
||||
if not path.exists():
|
||||
raise HTTPException(404, "TTS file not found")
|
||||
return FileResponse(path, media_type="application/json")
|
||||
|
||||
|
||||
@app.get("/")
|
||||
async def index(_=Depends(auth)):
|
||||
return FileResponse("static/index.html")
|
||||
@@ -92,4 +100,4 @@ async def card_back():
|
||||
|
||||
if __name__ == "__main__":
|
||||
import uvicorn
|
||||
uvicorn.run(app, host="0.0.0.0", port=PORT)
|
||||
uvicorn.run(app, host="0.0.0.0", port=PORT)
|
||||
Reference in New Issue
Block a user