Skip to content

Commit

Permalink
Add static path for developers
Browse files Browse the repository at this point in the history
This will use the docker storage location for developers

This path should not be reached in production as production is
recommedned to serve the paths via nginx
  • Loading branch information
optimumtact committed Aug 6, 2024
1 parent 9ab8962 commit 9e1ddc3
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions srht/blueprints/html.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
request,
redirect,
Response,
send_from_directory
)
from flask_login import current_user, login_user, logout_user
from sqlalchemy import desc
Expand Down Expand Up @@ -317,3 +318,8 @@ def uploads_admin(page):
per_page=_cfgi("perpage"),
)
return render_template("admin_uploads.html", pagination=uploads, endpoint="html.uploads_admin")


@html.route("/<path:filename>", methods=["GET"])
def serve_file(filename):
return send_from_directory('/storage', filename)

0 comments on commit 9e1ddc3

Please sign in to comment.