mirror of
https://github.com/PiBrewing/craftbeerpi4.git
synced 2024-12-29 17:01:44 +01:00
20 lines
468 B
Python
20 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)
|