Skip to content

Commit

Permalink
Hardcode favicon and utils.js in web.py to fix 404
Browse files Browse the repository at this point in the history
  • Loading branch information
justin025 committed Jan 27, 2025
1 parent 78929c9 commit eada144
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/onthespot/web.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,19 @@ def logout():
logout_user()
return redirect(url_for('login'))

# Hardcoding the next two entries because it seems they aren't detected
# by flask in the template or static folder.
@app.route('/favicon.ico')
def serve_favicon(filename):
favicon_path = os.path.join(config.app_root, 'resources', 'web', 'favicon.ico')
return send_file(favicon_path)


@app.route('/web/utils.js')
def serve_shared_js(filename):
js_path = os.path.join(config.app_root, 'resources', 'web', 'utils.js')
return send_file(js_path)


@app.route('/icons/<path:filename>')
def serve_icons(filename):
Expand Down

0 comments on commit eada144

Please sign in to comment.