code: def before_serving(self, func: Callable) -> Callable:
          
          handler = ensure_coroutine(func)
          self.before_serving_funcs.append(handler)
          return func
docs: Add a before serving function.
  
          This will allow the function provided to be called once before
          anything is served (before any byte is received).
  
          This is designed to be used as a decorator. An example usage,
  
          .. code-block:: python
  
              @app.before_serving
              def func():
                  ...
  
          Arguments:
              func: The function itself.