| from flask import Flask, send_from_directory, jsonify |
| import os |
|
|
| app = Flask(__name__, static_folder='.', static_url_path='') |
|
|
| @app.route('/') |
| def index(): |
| return send_from_directory('.', 'index.html') |
|
|
| @app.route('/<path:path>') |
| def serve_file(path): |
| try: |
| return send_from_directory('.', path) |
| except FileNotFoundError: |
| return jsonify({'error': 'File not found'}), 404 |
|
|
| @app.route('/health') |
| def health(): |
| return jsonify({'status': 'healthy'}) |
|
|
| if __name__ == '__main__': |
| port = int(os.environ.get('PORT', 7860)) |
| app.run(host='0.0.0.0', port=port) |
|
|