|
|
@@ -25,3 +25,10 @@ def mount_register_static_files(app):
|
|
|
def mount_main_static_files(app):
|
|
|
"""Mount static files"""
|
|
|
app.mount("/express/", StaticFiles(directory="public/main", html=False), name="public_root_assets")
|
|
|
+
|
|
|
+def serve_image(image_path: str):
|
|
|
+ """Serve images from the public/images directory"""
|
|
|
+ image_full_path = os.path.join("public", "images", image_path)
|
|
|
+ if not os.path.exists(image_full_path):
|
|
|
+ raise HTTPException(status_code=404, detail=f"Image '{image_path}' not found.")
|
|
|
+ return FileResponse(image_full_path)
|