rs_server_frontend/main.md¶
The frontend application.
Frontend
¶
The frontend application.
Source code in docs/rs-server/services/frontend/rs_server_frontend/main.py
__init__()
¶
Create a frontend application.
The frontend serves the rs-server REST API documentation. This documentation is an openapi specification loaded from a json file. This file location is given by the RSPY_OPENAPI_FILE environment variable.
This file is loaded during the frontend application initialization and is kept in memory cache for the entire life of the application.
A specific FrontendFailed exception is raised if the openapi loading failed.
Source code in docs/rs-server/services/frontend/rs_server_frontend/main.py
get_openapi()
¶
Returns the openapi specification.
Returns:
| Type | Description |
|---|---|
dict
|
the openapi specification as a dict. |
load_openapi_spec()
staticmethod
¶
Load the openapi specification.
The openapi is loaded from a json file. This json file location is given by the environment variable RSPY_OPENAPI_FILE.
An IOError is raised in case of errors during the file reading. A ValueError is raised in case of errors during the json parsing.
Returns:
| Type | Description |
|---|---|
dict
|
the loaded openapi specification |
Source code in docs/rs-server/services/frontend/rs_server_frontend/main.py
FrontendFailed
¶
HealthSchema
¶
start_app()
¶
Start the starlette app.
Factory function that starts the application.
Returns:
| Type | Description |
|---|---|
FastAPI
|
the initialized application |