123456789101112131415161718192021222324 |
- #!/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.variables import app as variables
- 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)
- ])
|