Spaces:
Sleeping
Sleeping
| from flask import Flask, render_template, send_from_directory, jsonify | |
| import os | |
| import logging | |
| # Configure logging | |
| logging.basicConfig(level=logging.INFO) | |
| logger = logging.getLogger(__name__) | |
| app = Flask(__name__) | |
| # Log startup | |
| logger.info("Starting Growth Loop Simulator application...") | |
| def index(): | |
| try: | |
| return render_template('index.html') | |
| except Exception as e: | |
| app.logger.error(f"Error rendering index: {e}") | |
| return f"Internal Server Error: {e}", 500 | |
| def health(): | |
| return jsonify({"status": "healthy"}), 200 | |
| # Removed manual static route to rely on Flask's native static file handling | |
| # ensuring standard behavior and reducing potential path resolution bugs. | |
| if __name__ == '__main__': | |
| # Log that we are using the __main__ entry point | |
| logger.info("Starting via python app.py on port 7860...") | |
| app.run(host='0.0.0.0', port=7860, debug=False) | |