doc(api): how to enable api openapi (formely swagger) frontend (#1773)
This commit is contained in:
parent
9fe6bbdd5e
commit
abd7084bb2
2 changed files with 19 additions and 2 deletions
20
api/NOTES.md
20
api/NOTES.md
|
|
@ -1,3 +1,21 @@
|
|||
#### autogenerated api frontend
|
||||
|
||||
API can autogenerate a frontend that documents, and allows to play
|
||||
with, in a limited way, its interface. Make sure you have the
|
||||
following variables inside the current `.env`:
|
||||
|
||||
```
|
||||
docs_url=/docs
|
||||
root_path=''
|
||||
```
|
||||
|
||||
If the `.env` that is in-use is based on `env.default` then it is
|
||||
already the case. Start, or restart the http server, then go to
|
||||
`https://127.0.0.1:8000/docs`. That is autogenerated documentation
|
||||
based on pydantic schema, fastapi routes, and docstrings :wink:.
|
||||
|
||||
Happy experiments, and then documentation!
|
||||
|
||||
#### psycopg3 API
|
||||
|
||||
I mis-remember the psycopg v2 vs. v3 API.
|
||||
|
|
@ -13,7 +31,7 @@ following pseudo code:
|
|||
return row["exists"]
|
||||
```
|
||||
|
||||
Minding the following:
|
||||
Mind the following:
|
||||
|
||||
- Where `app.state.postgresql` is the postgresql connection pooler.
|
||||
- Wrap explicit transaction with `async with cnx.transaction():
|
||||
|
|
|
|||
|
|
@ -11,7 +11,6 @@ captcha_server=
|
|||
change_password_link=/changepassword?invitation=%s&&pass=%s
|
||||
DEVTOOLS_MOB_PATTERN=%(sessionId)s/devtools.mobs
|
||||
docs_url=/docs
|
||||
docs_url=/docs
|
||||
EFS_DEVTOOLS_MOB_PATTERN=%(sessionId)s/devtools.mob
|
||||
EFS_SESSION_MOB_PATTERN=%(sessionId)s/dom.mob
|
||||
EMAIL_FROM=Openreplay-dev<do-not-reply@openreplay.com>
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue