| from flask import Flask | |
| # Create a Flask web application | |
| app = Flask(__name__) | |
| # This is the main page. It will respond to Hugging Face's health checks. | |
| def health_check(): | |
| # You can customize this message | |
| return "This page keeps the Minecraft server's Hugging Face Space alive. The server is running in the background!" | |
| # This runs the web server. | |
| if __name__ == '__main__': | |
| # It listens on all network interfaces (0.0.0.0) and on port 7860, | |
| # which is the default port for Hugging Face Spaces. | |
| app.run(host='0.0.0.0', port=7860) |