LineUp-Bot / app.py
Brozy123's picture
Update app.py
ae3db39 verified
Raw History Blame Contribute Delete
912 Bytes
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)