feat(trip-cluster): config, factory, CLI skeleton, health + thumb proxy
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import os
|
||||
from flask import Blueprint, current_app, send_file, abort
|
||||
|
||||
bp = Blueprint("proxy", __name__)
|
||||
|
||||
|
||||
@bp.route("/thumb/<asset_id>")
|
||||
def thumb(asset_id):
|
||||
cfg = current_app.config["APP_CONFIG"]
|
||||
safe = os.path.basename(asset_id)
|
||||
path = os.path.join(cfg.thumbs_dir, f"{safe}.jpg")
|
||||
if not os.path.exists(path):
|
||||
abort(404)
|
||||
return send_file(path, mimetype="image/jpeg")
|
||||
Reference in New Issue
Block a user