From 6fefc745061dba3b4f5117c4bf4caaf76ed4e28d Mon Sep 17 00:00:00 2001 From: Correl Date: Tue, 27 Sep 2022 19:44:43 -0400 Subject: [PATCH] Move API endpoints to /api/ path --- tutor/server.py | 4 ++-- www/src/App.elm | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/tutor/server.py b/tutor/server.py index e99665f..2a53d78 100644 --- a/tutor/server.py +++ b/tutor/server.py @@ -170,8 +170,8 @@ class Application(tornado.web.Application): "vars": {"version": version}, }, ), - (r"/search", SearchHandler), - (r"/collection", CollectionHandler), + (r"/api/search", SearchHandler), + (r"/api/collection", CollectionHandler), ] if static_path := settings.get("static"): paths.extend( diff --git a/www/src/App.elm b/www/src/App.elm index aa73b97..86f3939 100644 --- a/www/src/App.elm +++ b/www/src/App.elm @@ -139,7 +139,7 @@ search : Criteria -> Cmd Msg search criteria = loadPage <| Url.Builder.absolute - [ "search" ] + [ "api", "search" ] (Url.Builder.int "limit" 18 :: searchQuery criteria) @@ -154,7 +154,7 @@ loadPage url = getCollectionStatistics : Cmd Msg getCollectionStatistics = Http.get - { url = Url.Builder.absolute [ "collection" ] [] + { url = Url.Builder.absolute [ "api", "collection" ] [] , expect = Http.expectJson GotStatistics Collection.decodeStatistics }