Skip to content

Commit fc8b6cc

Browse files
committed
Better description for the API page.
1 parent 2327ba5 commit fc8b6cc

1 file changed

Lines changed: 24 additions & 1 deletion

File tree

‎src/paperoni/web/main.py‎

Lines changed: 24 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,33 @@ async def dispatch(self, request, call_next):
3737
return response
3838

3939

40+
_DESCRIPTION = """
41+
API for searching scientific papers and operate on Paperoni's database.
42+
43+
To use this API:
44+
45+
1. **Get a token**: [Click here](/token). Sign in with Google when
46+
prompted. When the flow finishes, the page will show your token — copy it and
47+
store it securely.
48+
49+
2. **Use the token**: Send it in the `Authorization` header as
50+
`Bearer YOUR_TOKEN`.
51+
52+
Example — search (first 10 results):
53+
54+
```
55+
curl -H 'Authorization: Bearer YOUR_TOKEN' 'https://paperoni.mila.quebec/api/v1/search?limit=10&offset=0'
56+
```
57+
58+
Replace `YOUR_TOKEN` with the token you copied and adjust the base URL if you
59+
use a different Paperoni instance.
60+
"""
61+
62+
4063
def create_app():
4164
app = FastAPI(
4265
title="Paperoni API",
43-
description="API for searching scientific papers",
66+
description=_DESCRIPTION,
4467
version=importlib.metadata.version(paperoni.__name__),
4568
openapi_tags=[
4669
{

0 commit comments

Comments
 (0)