File size: 569 Bytes
c488141
b1d48b4
c488141
b1d48b4
 
c488141
 
 
 
 
b1d48b4
c488141
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
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.
@app.route('/')
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)