Skip to content

Commit dff565a

Browse files
authored
Added last_updated to /v2/latest
Also added source info field
1 parent 09f3d3e commit dff565a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

app/routes/v2/latest.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
from flask import jsonify, current_app as app
22
from ...services import jhu
3+
from datetime import datetime
34

45
@app.route('/v2/latest')
56
def latest():
@@ -14,5 +15,7 @@ def latest():
1415
'confirmed': sum(map(lambda latest: latest['confirmed'], latest)),
1516
'deaths' : sum(map(lambda latest: latest['deaths'], latest)),
1617
'recovered': sum(map(lambda latest: latest['recovered'], latest)),
18+
'last_updated': datetime.utcnow().isoformat() + 'Z',
19+
'source': 'https://github.com/ExpDev07/coronavirus-tracker-api',
1720
}
18-
})
21+
})

0 commit comments

Comments
 (0)