serve

async AsyncYouTubeNotifier.serve(*, port: int = 8000, app: FastAPI = None, log_level: int = 30, **kwargs: Any) None

Start the FastAPI server to receive push notifications in an existing event loop.

Parameters:
  • port – The port to run the FastAPI server on.

  • app – The FastAPI app instance to use. If not provided, a new instance will be created.

  • log_level – The log level to use for the logger.

  • kwargs – Additional keyword arguments to pass to the FastAPI app.

Raises:

RuntimeError – If the method is not called from a running event loop.