From 79f606ccb9a190d9efde490c1c4a3121815544fe Mon Sep 17 00:00:00 2001 From: Galen Guyer Date: Thu, 25 Feb 2021 22:46:14 -0500 Subject: Add latest route --- poller/routes.py | 4 ++++ 1 file changed, 4 insertions(+) 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()) -- cgit v1.2.3