simple-asgi 0.0.2

Creator: bradpython12

Last updated:

0 purchases

simple-asgi 0.0.2 Image
simple-asgi 0.0.2 Images

Languages

Categories

Add to Cart

Description:

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)```

License

For personal and professional use. You cannot resell or redistribute these repositories in their original state.

Files In This Product:

Customer Reviews

There are no reviews.