serve_wsgi_request

Functionin wsgifastly-compute 0.1.3View source
serve_wsgi_request(req: http_req.Request, body: InputStream, app: Callable, handle_errors: bool = False) -> None

Serve a single WSGI request using the Fastly Compute API.

This function adapts between Fastly's WIT-based HTTP API and the WSGI specification, allowing any WSGI-compatible web framework to run on Fastly Compute.

Parameters

req: http_req.Request

Fastly HTTP request object from WIT bindings

body: InputStream

WSGI input stream containing the request body (PEP 3333 compliant)

app: Callable

WSGI application callable

handle_errors: booloptional = False

If True, log exceptions and return 500; otherwise let the server or WSGI app handle them

Returns

None