Name saved files with county, data type, and data date

This commit is contained in:
zyphlar
2026-04-09 22:24:38 -07:00
parent d904fb4f3d
commit 973b2350af
2 changed files with 33 additions and 34 deletions
+9
View File
@@ -278,6 +278,15 @@ def list_files():
return jsonify(files)
@app.route('/api/latest-date')
def latest_date():
"""Return the folder name that /data/latest symlinks to (used as data date in filenames)."""
try:
target = os.path.basename(os.path.realpath('/data/latest'))
return jsonify({'date': target})
except Exception:
return jsonify({'date': ''})
@app.route('/data/<path:filename>')
def serve_data(filename):
"""Serve GeoJSON files"""