Skip to main content
Python Software Foundation 20th Year Anniversary Fundraiser  Donate today!

ASGI adapter for Azure Functions

Project description

Bonnette

ASGI adapter for Azure Functions.

Package version Build Status

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.

Files for bonnette, version 0.1.1
Filename, size File type Python version Upload date Hashes
Filename, size bonnette-0.1.1.tar.gz (3.8 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page