Name saved files with county, data type, and data date
This commit is contained in:
@@ -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"""
|
||||
|
||||
Reference in New Issue
Block a user