def __init__(self, backend_wsgi_app, config_manager=None):
if config_manager is None:<EOL><INDENT>config_manager = api_config_manager.ApiConfigManager()<EOL><DEDENT>self.config_manager = config_manager<EOL>self._backend = backend_wsgi_app<EOL>self._dispatchers = []<EOL>for base_path in self._backend.base_paths:<EOL><INDENT>self._add_dispatcher('<STR_LIT>' % base_path,<EOL>self.handle_api_explorer_request)<EOL>self._add_dispatcher('<STR_LIT>' % base_path,<EOL>self.handle_api_static_request)<EOL><DEDENT>api_config_response = self.get_api_configs()<EOL>if api_config_response:<EOL><INDENT>self.config_manager.process_api_config_response(api_config_response)<EOL><DEDENT>else:<EOL><INDENT>raise api_exceptions.ApiConfigurationError('<STR_LIT>')<EOL><DEDENT>
Constructor for EndpointsDispatcherMiddleware.

        Args:
          backend_wsgi_app: A WSGI server that serves the app's endpoints.
          config_manager: An ApiConfigManager instance that allows a caller to
            set up an existing configuration for testing.