Skip to content

serve_app

faststream.asyncapi.site.serve_app #

serve_app(schema, host, port)

Serve the HTTPServer with AsyncAPI schema.

Source code in faststream/asyncapi/site.py
def serve_app(
    schema: "Schema",
    host: str,
    port: int,
) -> None:
    """Serve the HTTPServer with AsyncAPI schema."""
    logger.info(f"HTTPServer running on http://{host}:{port} (Press CTRL+C to quit)")
    logger.warning("Please, do not use it in production.")

    server.HTTPServer(
        (host, port),
        partial(_Handler, schema=schema),
    ).serve_forever()