Public Access
Fix route Media FastHTML native
Build and Push Docker Image / build-and-push (push) Successful in 37s
Build and Push Docker Image / build-and-push (push) Successful in 37s
This commit is contained in:
1 parent
d6db532a97
commit
6d509edbb9
1 file changed
+3
-4
@@ -50,10 +50,9 @@ app, rt = fast_app(
|
|||||||
|
|
||||||
app.mount("/Logo", StaticFiles(directory="Logo"), name="Logo")
|
app.mount("/Logo", StaticFiles(directory="Logo"), name="Logo")
|
||||||
|
|
||||||
# --- ROUTE MÉDIA INDESTRUCTIBLE (STARLETTE PUR) ---
|
# --- ROUTE MÉDIA INDESTRUCTIBLE (SYNTAXE FASHTHTML NATIVE) ---
|
||||||
@app.route('/Media/{fname:path}')
|
@rt('/Media/{fname:path}')
|
||||||
async def get_media(request):
|
def get(fname: str):
|
||||||
fname = request.path_params['fname']
|
|
||||||
chemin = os.path.join(dossier_media, fname)
|
chemin = os.path.join(dossier_media, fname)
|
||||||
if os.path.exists(chemin):
|
if os.path.exists(chemin):
|
||||||
try:
|
try:
|
||||||
|
|||||||
Reference in new issue
Block a user