Devcontainer backend dev (#608)

add backend-dev devcontainer and extract openapi.json to docs/
This commit is contained in:
Andrew Maguire
2023-01-11 17:09:02 +01:00
committed by GitHub
parent 991ff68d0a
commit b1fbd0fa96
7 changed files with 1984 additions and 2 deletions
+15
View File
@@ -44,3 +44,18 @@ run `alembic revision --autogenerate -m "..."` ("..." is what you did) in the
`/backend` directory. Then edit the newly created file. See
[here](https://alembic.sqlalchemy.org/en/latest/tutorial.html) for more
information.
## API Documentation
Once you have successfully started the backend server, you can access the
default api docs at `localhost:8080/docs`. If you need to update the exported
openapi.json in the docs/ folder you can run below command to `wget` them from
the relevant local fastapi endpoint. This will enable anyone to just see API
docs via something like
[Swagger.io](https://editor.swagger.io/?url=https://raw.githubusercontent.com/LAION-AI/Open-Assistant/main/docs/docs/api/openapi.json)
without having to actually set up and run a development backend.
```bash
# save openapi.json to docs/docs/api
wget localhost:8080/api/v1/openapi.json -O docs/docs/api/openapi.json
```