1234567891011121314151617181920212223 |
- #!/usr/bin/env python3
-
- from starlette.routing import Router, Mount, Route
- from starlette.responses import HTMLResponse
- from starlette.exceptions import HTTPException
-
- from pyheatpump.config import app as config
- from pyheatpump.heatpump import app as heatpump
- from pyheatpump.variable_types import app as types
- from pyheatpump.variable_values import app as values
-
- async def index(request):
- with open('index.html') as html:
- return HTMLResponse(html.read())
- raise HTTPException(404)
-
- application = Router(routes=[
- Route('/', index),
- Mount('/config', config),
- Mount('/heatpump', heatpump),
- Mount('/variables', types),
- Mount('/values', values)
- ])
|