mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-11-26 00:48:40 +01:00
19 lines
468 B
Python
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)
|