Implemented modular code structure

Refactored repository into kaya-core and kaya-rsgi packages
This commit is contained in:
2026-07-15 22:18:45 +08:00
parent eca6da3dc3
commit fa3ff32f66
33 changed files with 238 additions and 387 deletions
+2 -11
View File
@@ -1,15 +1,6 @@
from kaya import KayaApp, HttpContext, HttpMethod, WebSocket
from kaya.core import KayaApp, HttpContext, HttpMethod, WebSocket
from typing import List
class Hello(KayaApp):
pass
# async def handle_request(self, ctx: HttpContext) -> None:
# async for chunk in ctx.request_body:
# print(chunk.decode())
# await ctx.send_str(200, 'Hello World')
app = KayaApp()
@@ -53,4 +44,4 @@ async def echo(ws: WebSocket) -> None:
elif msg.kind == 'binary':
data = msg.data
assert isinstance(data, bytes)
await ws.send_bytes(data)
await ws.send_bytes(data)