You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/app/api-details.md
+1-23Lines changed: 1 addition & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,28 +4,6 @@ See [Technical Overview](./technical-overview.md) for details on the technologie
4
4
5
5
Each endpoint is configured in the [openapi.generated.yml](/app/openapi.generated.yml) file which provides basic request validation. Each endpoint specifies an `operationId` that maps to a function defined in the code that will handle the request.
6
6
7
-
To make handling a request easier, an [ApiContext](/app/src/util/api_context.py) exists which will fetch the DB session, request body, and current user. This can be used like so:
data={"db_model_id": "1234"}, # Whatever the response object should be
24
-
status_code=201
25
-
)
26
-
```
27
-
For more complex usages, it is recommended you put the implementation into a separate handler file in order to keep the API entrypoints easier to read.
28
-
29
7
# Swagger
30
8
31
9
The Swagger UI can be reached locally at [http://localhost:8080/docs](http://localhost:8080/docs) when running the API. The UI is based on the [openapi.generated.yml](/app/openapi.generated.yml) file.
@@ -39,7 +17,7 @@ All model schemas defined can be found at the bottom of the UI.
39
17
# Routes
40
18
41
19
## Health Check
42
-
[GET /v1/healthcheck](/app/src/route/healthcheck.py) is an endpoint for checking the health of the service. It verifies that the database is reachable, and that the API service itself is up and running.
20
+
[GET /v1/healthcheck](/app/src/api/healthcheck.py) is an endpoint for checking the health of the service. It verifies that the database is reachable, and that the API service itself is up and running.
43
21
44
22
Note this endpoint explicitly does not require authorization so it can be integrated with any automated monitoring you may build.
Copy file name to clipboardExpand all lines: docs/app/database/database-access-management.md
+1-1Lines changed: 1 addition & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ This document describes the best practices and patterns for how the application
4
4
5
5
## Client Initialization and Configuration
6
6
7
-
The database client is initialized when the application starts (see [src/\_\_main\_\_.py](../../../app/src/app.py). The database engine that is used to create acquire connections to the database is initialized using the database configuration defined in [db_config.py](../../../app/src/db/db_config.py), which is configured through environment variables. The initialized database client is then stored on the Flask app's [\`extensions\` dictionary](https://flask.palletsprojects.com/en/2.2.x/src/#flask.Flask.extensions) to be used throughout the lifetime of the application.
7
+
The database client is initialized when the application starts (see [`src/__main__.py`](../../../app/src/app.py)). The database engine that is used to acquire connections to the database is initialized using the database configuration defined in [postgres_config.py](../../../app/src/adapters/db/clients/postgres_config.py), which is configured through environment variables. The initialized database client is then stored on the Flask app's [`extensions` dictionary](https://flask.palletsprojects.com/en/2.2.x/extensions/) to be used throughout the lifetime of the application.
0 commit comments