Trae Assistant
feat: upgrade pmf radar studio with file upload and optimizations
568f4d9
raw
history blame contribute delete
945 Bytes
from flask import Flask, render_template, send_from_directory, request, jsonify
import os
app = Flask(__name__)
# Fix conflict between Jinja2 and Vue.js delimiters
# We will use Vue's delimiters ['${', '}'] in the frontend,
# but we also change Jinja2's just in case to avoid confusion.
app.jinja_env.variable_start_string = '[['
app.jinja_env.variable_end_string = ']]'
app.jinja_env.block_start_string = '[%'
app.jinja_env.block_end_string = '%]'
@app.route('/')
def index():
return send_from_directory('static', 'index.html')
@app.route('/health')
def health():
return "OK", 200
# Explicitly serve static files if needed (Flask does this by default from static folder, but good for explicit control)
@app.route('/static/<path:path>')
def send_static(path):
return send_from_directory('static', path)
if __name__ == '__main__':
port = int(os.environ.get('PORT', 7860))
app.run(host='0.0.0.0', port=port, debug=True)