class_docstr: Standalone WSGI app that can serve files, etc.
class_docstr_tok: ["Standalone","WSGI","app","that","can","serve","files",",","etc","."]
docstr: Implementation of the WSGI interface.
docstr_tok: ["Implementation","of","the","WSGI","interface","."]
code: def __call__(self, environ, start_response):
      """Implementation of the WSGI interface."""
      request = wrappers.Request(environ)
  
      try:
          parsed_url = urlparse(request.path)
  
          # Remove a trailing slash, if present.
          clean_path = parsed_url.path
          if clean_path.endswith("/"):
              clean_path = clean_path[:-1]
  
          if clean_path in self._handlers:
              return self._ServeCustomHandler(
                  request, clean_path, environ
              )(environ, start_response)
          else:
              is_index = not clean_path or clean_path == "/index.html"
              if is_index:
                  clean_path = os.path.join(
                      self._project_root, self._index_file
                  )
              else:
                  # Strip off the leading forward slash. Don't do it for index because
                  # in the vulcanized version we use an absolute path.
                  clean_path = os.path.join(
                      self._project_root, clean_path.lstrip("/")
                  )
  
              response = self._ServeStaticFile(request, clean_path)
  
      except Exception as e:  # pylint: disable=broad-except
          errors = (str(e), str(traceback.format_exc()))
          html_response = "Uncaught error: %s\n\nDetails: %s" % errors
          logging.error("Uncaught error: %s \n\n %s", *errors)
          response = self.respond(
              request, html_response, "text/html", 500
          )
  
      return response(environ, start_response)
  
file_path: lit/lit_nlp/lib/wsgi_app.py
imports: import mimetypes
  import os
  import time
  import traceback
  import wsgiref.handlers
  from absl import logging
  import six
  from six.moves.urllib.parse import urlparse
  from werkzeug import wrappers
label_desc: Use image node_id 6 for calling the App obj's underlying member method code with example usage: obj.__call__(environ, start_response) and returns: response, self