Route Media native Starlette path_params
Build and Push Docker Image / build-and-push (push) Successful in 35s

This commit is contained in:
xavier committed 2026-08-26 20:06:52 +02:00
1 parent 7a0f580fa8
commit d6db532a97
1 file changed
+4 -3
+4 -3
View File
@@ -50,9 +50,10 @@ app, rt = fast_app(
app.mount("/Logo", StaticFiles(directory="Logo"), name="Logo")
# --- LECTURE EN RAM (Syntaxe Native FastHTML) ---
@rt('/Media/{fname:path}')
def get(fname: str):
# --- ROUTE MÉDIA INDESTRUCTIBLE (STARLETTE PUR) ---
@app.route('/Media/{fname:path}')
async def get_media(request):
fname = request.path_params['fname']
chemin = os.path.join(dossier_media, fname)
if os.path.exists(chemin):
try: