File size: 423 Bytes
db00baf
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
from flask import Flask
import os

app = Flask(__name__)

@app.route('/')
def hello_world():
    # This page will be pinged to keep the Space alive
    return "Bot is alive and running!"

if __name__ == "__main__":
    # Hugging Face Spaces expect the app to run on port 7860
    port = int(os.environ.get("PORT", 7860))
    # Use 0.0.0.0 to be accessible within the Docker container
    app.run(host='0.0.0.0', port=port)