Spaces:
Runtime error
Runtime error
File size: 912 Bytes
ae3db39 2078b09 ae3db39 2078b09 ae3db39 6f1e1a8 2078b09 f8f3961 | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 | from flask import Flask, send_from_directory, redirect
app = Flask(__name__, static_folder='.', static_url_path='/')
@app.route('/')
def index():
return send_from_directory('.', 'dashboard.html')
@app.route('/league')
def league():
# Serve the league page (alias)
return send_from_directory('.', 'league.html')
@app.route('/league/')
def league_trailing_slash():
# Redirect trailing slash to canonical path
return redirect('/league.html')
@app.route('/league.html')
def league_html():
# Alias to support environments that request the .html path explicitly
return send_from_directory('.', 'league.html')
@app.route('/<path:path>')
def static_proxy(path):
# Serve static files (images, js, css) if referenced
return send_from_directory('.', path)
if __name__ == '__main__':
import os
port = int(os.environ.get('PORT', 8000))
app.run(host='0.0.0.0', port=port) |