We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 84716f1 commit 82d2232Copy full SHA for 82d2232
src/labthings_fastapi/server/fallback.py
@@ -3,7 +3,16 @@
3
from fastapi.responses import HTMLResponse
4
from starlette.responses import RedirectResponse
5
6
-app = FastAPI()
+
7
+class FallbackApp(FastAPI):
8
+ def __init__(self, *args, **kwargs):
9
+ super().__init__(*args, **kwargs)
10
+ self.labthings_config = None
11
+ self.labthings_server = None
12
+ self.labthings_error = None
13
14
15
+app = FallbackApp()
16
17
ERROR_PAGE = """
18
<!DOCTYPE html>
@@ -27,10 +36,6 @@
27
36
</html>
28
37
"""
29
38
30
-app.labthings_config = None
31
-app.labthings_server = None
32
-app.labthings_error = None
33
-
34
39
35
40
@app.get("/")
41
async def root():
0 commit comments