Frontend
The frontend application.
Frontend
The frontend application.
Source code in docs/rs-server/services/frontend/rs_server_frontend/main.py
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 |
|
__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
39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 |
|
get_openapi()
Returns the openapi specification.
Returns:
Type | Description |
---|---|
dict
|
the openapi specification as a dict. |
Source code in docs/rs-server/services/frontend/rs_server_frontend/main.py
115 116 117 118 119 120 121 |
|
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
87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 |
|
FrontendFailed
Bases: BaseException
Exception raised if the frontend initialization failed.
Source code in docs/rs-server/services/frontend/rs_server_frontend/main.py
26 27 |
|
HealthSchema
Bases: BaseModel
Health status flag.
Source code in docs/rs-server/services/frontend/rs_server_frontend/main.py
30 31 32 33 |
|
start_app()
Start the starlette app.
Factory function that starts the application.
Returns:
Type | Description |
---|---|
FastAPI
|
the initialized application |
Source code in docs/rs-server/services/frontend/rs_server_frontend/main.py
124 125 126 127 128 129 130 131 132 133 |
|