[docs]asyncdefserve(self):""" Creates and serves the proxy using hypercorn. """fromhypercorn.asyncioimportservefromhypercorn.typingimportFrameworkfromhypercorn.utilsimportLifespanFailureErrorhypercorn_config=self._create_hypercorn_config(self.system.binds)logger.debug(f"🌎 {type(self).__name__}::serve({', '.join(hypercorn_config.bind)})")try:returnawaitserve(cast(Framework,self.system.asgi_app),hypercorn_config,mode="asgi")exceptLifespanFailureErrorasexc:logger.exception(f"Server initiliation failed: {repr(exc.__cause__)}",exc_info=exc.__cause__)ifisinstance(exc.__cause__,PostgresError):logger.error("Could not connect to underlying postgres storage backend, check your config.")sys.exit(-1)