Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Added last_updated to /v2/latest
Also added source info field
  • Loading branch information
whitehat007 authored Mar 19, 2020
commit dff565a10fe36a12b3711ea2bbf718cec11ccfb2
5 changes: 4 additions & 1 deletion app/routes/v2/latest.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
from flask import jsonify, current_app as app
from ...services import jhu
from datetime import datetime

@app.route('/v2/latest')
def latest():
Expand All @@ -14,5 +15,7 @@ def latest():
'confirmed': sum(map(lambda latest: latest['confirmed'], latest)),
'deaths' : sum(map(lambda latest: latest['deaths'], latest)),
'recovered': sum(map(lambda latest: latest['recovered'], latest)),
'last_updated': datetime.utcnow().isoformat() + 'Z',
'source': 'https://github.com/ExpDev07/coronavirus-tracker-api',
}
})
})