code: def setup(app: web.Application, *,
            defaults: Mapping[str, Union[ResourceOptions,
                                         Mapping[str, Any]]]=None) -> CorsConfig:
      
      cors = CorsConfig(app, defaults=defaults)
      app[APP_CONFIG_KEY] = cors
      return cors
docs: Setup CORS processing for the application.
  
      To enable CORS for a resource you need to explicitly add route for
      that resource using `CorsConfig.add()` method::
  
          app = aiohttp.web.Application()
          cors = aiohttp_cors.setup(app)
          cors.add(
              app.router.add_route("GET", "/resource", handler),
              {
                  "*": aiohttp_cors.ResourceOptions(
                      allow_credentials=True,
                      expose_headers="*",
                      allow_headers="*"),
              })
  
      :param app:
          The application for which CORS will be configured.
      :param defaults:
          Default settings for origins.
      )