ASGI adapter for Azure Functions
Project description
Bonnette
ASGI adapter for Azure Functions.
Requirements: Python 3.6
Installation
pip3 install bonnette
Example
import logging
import azure.functions as func
from bonnette import Bonnette
async def app(scope, receive, send):
assert scope["type"] == "http"
await send(
{
"type": "http.response.start",
"status": 200,
"headers": [[b"content-type", b"text/html; charset=utf-8"]],
}
)
await send(
{"type": "http.response.body", "body": b"<html><h1>Hello, world!</h1></html>"}
)
def main(req: func.HttpRequest) -> func.HttpResponse:
logging.info("Python HTTP trigger function processed a request.")
handler = Bonnette(app)
return handler(req)
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
bonnette-0.1.0.tar.gz
(3.7 kB
view details)
File details
Details for the file bonnette-0.1.0.tar.gz
.
File metadata
- Download URL: bonnette-0.1.0.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.13.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/40.6.2 requests-toolbelt/0.9.1 tqdm/4.34.0 CPython/3.6.8rc1
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 36b618cb78b82de61910b0746592f123cbe713ab0788f32f26276271fbe00d38 |
|
MD5 | 01fd57195d0e580c1e34a0ea6fd510bd |
|
BLAKE2b-256 | 11a91e1cc196564e17315a173be82e1652bafc48c7ec963030180d0eb410226e |