duqing2026's picture
Fix 500 error and add Dark theme
1ba8c78
Raw
History Blame Contribute Delete
661 Bytes
from flask import Flask, render_template, send_from_directory
import os
app = Flask(__name__, static_folder='static', template_folder='templates')
@app.route('/')
def index():
return render_template('index.html')
@app.route('/health')
def health():
return "OK", 200
@app.route('/static/<path:path>')
def send_static(path):
return send_from_directory('static', path)
@app.errorhandler(404)
def page_not_found(e):
return render_template('index.html'), 404
@app.errorhandler(500)
def internal_server_error(e):
return "Internal Server Error: " + str(e), 500
if __name__ == '__main__':
app.run(host='0.0.0.0', port=7860, debug=False)