asyncbasehttp-1.0
توضیحات
Simple async wrapper to python http server
| ویژگی | مقدار |
|---|---|
| سیستم عامل | - |
| نام فایل | asyncbasehttp-1.0 |
| نام | asyncbasehttp |
| نسخه کتابخانه | 1.0 |
| نگهدارنده | [] |
| ایمیل نگهدارنده | [] |
| نویسنده | balki |
| ایمیل نویسنده | asyncbasehttp@balki.me |
| آدرس صفحه اصلی | https://gitlab.com/balki/asyncbasehttp |
| آدرس اینترنتی | https://pypi.org/project/asyncbasehttp/ |
| مجوز | - |
# Async Http Server
The simplest async python http server library.
# Example
import asyncio
from asyncbasehttp import request_handler, Request, Response
@request_handler
async def handle_request(req: Request):
return Response.create_ok_response(f'You requested path: {req.path}'.encode())
async def main():
server = await asyncio.start_server(handle_request, port=8000)
print("http://localhost:8000")
await server.serve_forever()
asyncio.run(main())
نحوه نصب
نصب پکیج whl asyncbasehttp-1.0:
pip install asyncbasehttp-1.0.whl
نصب پکیج tar.gz asyncbasehttp-1.0:
pip install asyncbasehttp-1.0.tar.gz