Skip to content

Commit

Permalink
move static files somewhere else if possible
Browse files Browse the repository at this point in the history
  • Loading branch information
Kunsi committed Dec 29, 2023
1 parent b07eea6 commit fb735b9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions frontend.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,10 @@
from redis_session import RedisSessionStore
from voc_mqtt import send_message

app = Flask(__name__)
app = Flask(
__name__,
static_folder=CONFIG.get('STATIC_PATH', 'static'),
)
app.wsgi_app = ProxyFix(app.wsgi_app)

for copy_key in (
Expand All @@ -61,7 +64,7 @@ def cached_asset_name(asset):
asset_id,
"jpg" if asset["filetype"] == "image" else "mp4",
)
cache_name = f"static/{filename}"
cache_name = os.path.join(CONFIG.get('STATIC_PATH', 'static'), filename)

if not os.path.exists(cache_name):
app.logger.info(f"fetching {asset_id} to {cache_name}")
Expand Down

0 comments on commit fb735b9

Please sign in to comment.