added playlist view
This commit is contained in:
12
app.py
12
app.py
@@ -16,7 +16,7 @@ def create_app():
|
||||
app = Flask(__name__)
|
||||
|
||||
# Configure basic logging
|
||||
log_file='flask_server.log'
|
||||
log_file = 'flask_server.log'
|
||||
logging.basicConfig(
|
||||
level=logging.INFO,
|
||||
format='%(asctime)s %(levelname)s %(name)s %(threadName)s : %(message)s',
|
||||
@@ -48,11 +48,17 @@ def create_app():
|
||||
def serve_index():
|
||||
return render_template('main.html')
|
||||
|
||||
# Add this new route for config page
|
||||
# Config page route
|
||||
@app.route('/config')
|
||||
def serve_config():
|
||||
return render_template('config.html')
|
||||
|
||||
# New route: Serve playlist.html under /playlist/<id>
|
||||
@app.route('/playlist/<id>')
|
||||
def serve_playlist(id):
|
||||
# The id parameter is captured, but you can use it as needed.
|
||||
return render_template('playlist.html')
|
||||
|
||||
@app.route('/static/<path:path>')
|
||||
def serve_static(path):
|
||||
return send_from_directory('static', path)
|
||||
@@ -90,4 +96,4 @@ if __name__ == '__main__':
|
||||
app = create_app()
|
||||
logging.info("Starting Flask server on port 7171")
|
||||
from waitress import serve
|
||||
serve(app, host='0.0.0.0', port=7171)
|
||||
serve(app, host='0.0.0.0', port=7171)
|
||||
|
||||
Reference in New Issue
Block a user