Spaces:
Sleeping
Sleeping
from flask import Flask, render_template, send_from_directory | |
import os | |
'''# Configure SocketIO with eventlet for WebSocket support and specific CORS origin | |
socketio = SocketIO(app, | |
cors_allowed_origins="https://broadfield-dev-spore-grok.hf.space", # Your Spaces URL | |
async_mode='eventlet') # Use eventlet for WebSocket support | |
''' | |
app = Flask(__name__) | |
def index(): | |
return render_template('index.html') | |
def send_static(path): | |
return send_from_directory('static', path) | |
if __name__ == '__main__': | |
port = int(os.getenv("PORT", 7860)) # Default port for Hugging Face Spaces | |
app.run(host="0.0.0.0", port=port) |