diff options
author | Galen Guyer <galen@galenguyer.com> | 2021-02-25 22:46:14 -0500 |
---|---|---|
committer | Galen Guyer <galen@galenguyer.com> | 2021-02-25 22:46:14 -0500 |
commit | 79f606ccb9a190d9efde490c1c4a3121815544fe (patch) | |
tree | b540a68e1ea4d323493616d678d46effcda7cc97 /poller | |
parent | 52acb063dd83c7856d5c8d2be9618ea2000d4470 (diff) |
Add latest route
Diffstat (limited to 'poller')
-rw-r--r-- | poller/routes.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/poller/routes.py b/poller/routes.py index 4c0010b..6911fdd 100644 --- a/poller/routes.py +++ b/poller/routes.py @@ -5,3 +5,7 @@ from .models import Day @APP.route('/api/v0/history') def _get_api_v0_history(): return jsonify([day.serialize() for day in Day.get_all()]) + +@APP.route('/api/v0/latest') +def _get_api_v0_latest(): + return jsonify(Day.get_all()[-1].serialize()) |