Public Access
Route Media native Starlette path_params
Build and Push Docker Image / build-and-push (push) Successful in 35s
Build and Push Docker Image / build-and-push (push) Successful in 35s
This commit is contained in:
1 parent
7a0f580fa8
commit
d6db532a97
1 file changed
+4
-3
@@ -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:
|
||||
|
||||
Reference in new issue
Block a user