craftbeerpi4-pione/venv3/lib/python3.7/site-packages/cbpi4ui/__init__.py
2021-03-03 23:49:41 +01:00

19 lines
468 B
Python

import os
from aiohttp import web
from cbpi.api import *
class CBPiUi(CBPiExtension):
@request_mapping(path="/", auth_required=False)
async def hello_world(self, request):
return web.Response(text="Hello, world")
def __init__(self, cbpi):
self.cbpi = cbpi
path = os.path.dirname(__file__)
self.cbpi.register(self, "/cbpi_ui", static=os.path.join(path, "build"))
def setup(cbpi):
cbpi.plugin.register("UI", CBPiUi)