0 purchases
simpleasgi 0.0.2
# Simple ASGI HTTP 1.1 server implementationThis framework was inspired by [hypercorn](https://pgjones.gitlab.io/hypercorn/index.html) framework.## How to install```bashpip install simple-asgi```## Example```pythonimport osimport socketfrom simple_asgi import appfrom simple_asgi import responsefrom simple_asgi import routerasync def hello(request): request_body = await request.data return response.Response(body=request_body)sock_path = "/tmp/fn.sock"sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)try: os.remove(sock_path)finally: sock.bind("/tmp/fn.sock")rtr = router.Router()rtr.add("/call", ["POST"], hello)http_app = app.SimpleASGI(name=__name__, router=rtr)http_app.run(sock=sock)```
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.