Metadata-Version: 2.1
Name: simple-asgi
Version: 0.0.1
Summary: Simple ASGI HTTP 1.1 web server
Home-page: https://github.com/denismakogon
Author: Denis Makogon
Author-email: denys.makogon@oracle.com
License: UNKNOWN
Platform: UNKNOWN
Classifier: Intended Audience :: Information Technology
Classifier: Intended Audience :: System Administrators
Classifier: License :: OSI Approved :: Apache Software License
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.7
Requires-Dist: pbr (!=2.1.0,>=2.0.0)
Requires-Dist: hypercorn (==0.4.6)
Requires-Dist: multidict (==4.5.2)

# Simple ASGI HTTP 1.1 server implementation

This framework was inspired by [hypercorn](https://pgjones.gitlab.io/hypercorn/index.html) framework.

## How to install

```bash
pip install simple-asgi
```

## Example

```python
import os
import socket


from simple_asgi import app
from simple_asgi import response
from simple_asgi import router


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

```



