from my_modules.app.setup import LIMITER from quart import Blueprint, send_from_directory, render_template, current_app, Response, redirect basic_bp = Blueprint('basic', __name__) @basic_bp.route('/favicon', methods=['GET']) @basic_bp.route('/favicon.ico', methods=['GET']) @LIMITER.exempt async def favicon(): file_data = await current_app.convex.get_current_favicon() return redirect(file_data['file_id']) @basic_bp.route('/robots.txt', methods=['GET']) @LIMITER.limit('3 per day') async def robots(): return await send_from_directory(current_app.static_folder, f'robots.txt') @basic_bp.route("/storage/") async def convex_storage_proxy(file_id:str): return Response( current_app.convex.stream_from_storage(file_id, add_api_path=True), mimetype="application/octet-stream" )