Spaces:
Running
Running
Update main.py
Browse files
main.py
CHANGED
|
@@ -188,6 +188,16 @@ def generate_all_narrations_async(data_dict, uid, epiphany_id):
|
|
| 188 |
# -----------------------------------------------------------------------------
|
| 189 |
# 4. EPIPHANY SYNTHESIS (THE DISCOVERY ENDPOINTS)
|
| 190 |
# -----------------------------------------------------------------------------
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 191 |
|
| 192 |
@app.route('/api/epiphany/generate', methods=['POST'])
|
| 193 |
def generate_epiphany():
|
|
|
|
| 188 |
# -----------------------------------------------------------------------------
|
| 189 |
# 4. EPIPHANY SYNTHESIS (THE DISCOVERY ENDPOINTS)
|
| 190 |
# -----------------------------------------------------------------------------
|
| 191 |
+
@app.route('/api/image-proxy', methods=['GET'])
|
| 192 |
+
def image_proxy():
|
| 193 |
+
"""Proxies images from Firebase Storage to bypass CORS/Preview issues."""
|
| 194 |
+
image_url = request.args.get('url')
|
| 195 |
+
if not image_url: return jsonify({'error': 'No URL'}), 400
|
| 196 |
+
try:
|
| 197 |
+
resp = requests.get(image_url, timeout=10)
|
| 198 |
+
return Response(resp.content, content_type=resp.headers['Content-Type'])
|
| 199 |
+
except Exception as e:
|
| 200 |
+
return jsonify({'error': str(e)}), 500
|
| 201 |
|
| 202 |
@app.route('/api/epiphany/generate', methods=['POST'])
|
| 203 |
def generate_epiphany():
|