Move API endpoints to /api/ path
This commit is contained in:
parent
cb0656427a
commit
6fefc74506
2 changed files with 4 additions and 4 deletions
|
@ -170,8 +170,8 @@ class Application(tornado.web.Application):
|
||||||
"vars": {"version": version},
|
"vars": {"version": version},
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
(r"/search", SearchHandler),
|
(r"/api/search", SearchHandler),
|
||||||
(r"/collection", CollectionHandler),
|
(r"/api/collection", CollectionHandler),
|
||||||
]
|
]
|
||||||
if static_path := settings.get("static"):
|
if static_path := settings.get("static"):
|
||||||
paths.extend(
|
paths.extend(
|
||||||
|
|
|
@ -139,7 +139,7 @@ search : Criteria -> Cmd Msg
|
||||||
search criteria =
|
search criteria =
|
||||||
loadPage <|
|
loadPage <|
|
||||||
Url.Builder.absolute
|
Url.Builder.absolute
|
||||||
[ "search" ]
|
[ "api", "search" ]
|
||||||
(Url.Builder.int "limit" 18 :: searchQuery criteria)
|
(Url.Builder.int "limit" 18 :: searchQuery criteria)
|
||||||
|
|
||||||
|
|
||||||
|
@ -154,7 +154,7 @@ loadPage url =
|
||||||
getCollectionStatistics : Cmd Msg
|
getCollectionStatistics : Cmd Msg
|
||||||
getCollectionStatistics =
|
getCollectionStatistics =
|
||||||
Http.get
|
Http.get
|
||||||
{ url = Url.Builder.absolute [ "collection" ] []
|
{ url = Url.Builder.absolute [ "api", "collection" ] []
|
||||||
, expect = Http.expectJson GotStatistics Collection.decodeStatistics
|
, expect = Http.expectJson GotStatistics Collection.decodeStatistics
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue