mirror of
https://github.com/ilri/dspace-statistics-api.git
synced 2024-11-25 23:58:18 +01:00
Change / route to /items
I think it's more obvious if the "all items" route is plural. Also, this will allow me to eventually put documentation at the root.
This commit is contained in:
parent
f30a464cd1
commit
4cf8656b35
@ -14,7 +14,7 @@ Create a virtual environment and run it:
|
|||||||
## Using the API
|
## Using the API
|
||||||
The API exposes the following endpoints:
|
The API exposes the following endpoints:
|
||||||
|
|
||||||
- GET `/` — return views and downloads for all items that Solr knows about¹. Accepts `limit` and `page` query parameters for pagination of results.
|
- GET `/items` — return views and downloads for all items that Solr knows about¹. Accepts `limit` and `page` query parameters for pagination of results.
|
||||||
- GET `/item/id` — return views and downloads for a single item (*id* must be a positive integer).
|
- GET `/item/id` — return views and downloads for a single item (*id* must be a positive integer).
|
||||||
|
|
||||||
¹ We are querying the Solr statistics core, which technically only knows about all items that have either views or downloads.
|
¹ We are querying the Solr statistics core, which technically only knows about all items that have either views or downloads.
|
||||||
|
2
app.py
2
app.py
@ -59,7 +59,7 @@ class ItemResource:
|
|||||||
resp.media = statistics
|
resp.media = statistics
|
||||||
|
|
||||||
api = falcon.API()
|
api = falcon.API()
|
||||||
api.add_route('/', AllItemsResource())
|
api.add_route('/items', AllItemsResource())
|
||||||
api.add_route('/item/{item_id:int}', ItemResource())
|
api.add_route('/item/{item_id:int}', ItemResource())
|
||||||
|
|
||||||
# vim: set sw=4 ts=4 expandtab:
|
# vim: set sw=4 ts=4 expandtab:
|
||||||
|
Loading…
Reference in New Issue
Block a user