create core framework
This commit is contained in:
20
core/example/hello.py
Normal file
20
core/example/hello.py
Normal file
@@ -0,0 +1,20 @@
|
||||
from bugis.core import BugisApp, HttpContext
|
||||
|
||||
|
||||
class Hello(BugisApp):
|
||||
|
||||
async def handle_request(self, ctx: HttpContext) -> None:
|
||||
async for chunk in ctx.request_body:
|
||||
print(chunk)
|
||||
await ctx.send_str(200, 'Hello World')
|
||||
|
||||
|
||||
app = BugisApp()
|
||||
|
||||
|
||||
@app.GET('/hello')
|
||||
@app.GET('/hello2')
|
||||
async def handle_request(ctx: HttpContext) -> None:
|
||||
async for chunk in ctx.request_body:
|
||||
print(chunk)
|
||||
await ctx.send_str(200, 'Hello World')
|
Reference in New Issue
Block a user