|
@@ -1,10 +1,24 @@
|
1
|
1
|
#!/usr/bin/env python3
|
2
|
2
|
|
3
|
|
-from starlette.routing import Router
|
4
|
|
-from starlette.mounting import Mount
|
|
3
|
+from starlette.routing import Router, Mount, Route
|
|
4
|
+from starlette.responses import HTMLResponse
|
|
5
|
+from starlette.exceptions import HTTPException
|
5
|
6
|
|
6
|
|
-app = Router(routes=[
|
|
7
|
+from pyheatpump.config import config
|
|
8
|
+from pyheatpump.heatpump import app as heatpump
|
|
9
|
+from pyheatpump.variable_types import app as types
|
|
10
|
+from pyheatpump.variables import app as variables
|
|
11
|
+from pyheatpump.variable_values import app as values
|
|
12
|
+
|
|
13
|
+async def index(request):
|
|
14
|
+ with open('index.html') as html:
|
|
15
|
+ return HTMLResponse(html.read())
|
|
16
|
+ raise HTTPException(404)
|
|
17
|
+
|
|
18
|
+application = Router(routes=[
|
7
|
19
|
Route('/', index),
|
8
|
|
- Mount('/heatpump', heatpump),
|
9
|
20
|
Mount('/config', config),
|
|
21
|
+ Mount('/heatpump', heatpump),
|
|
22
|
+ Mount('/variables', types),
|
|
23
|
+ Mount('/values', values)
|
10
|
24
|
])
|