class_docstr: Main entry point into a Falcon-based app. An instance provides a callable WSGI interface and a
  routing engine.
class_docstr_tok: ["Main","entry","point","into","a","Falcon-based","app",".","An","instance","provides","a","callable","WSGI","interface","and","a","routing","engine","."]
code: def __init__(self, storage, config=None):
      # By default, server will reject requests coming from a server
      # with different origin. E.g., if server is hosted at
      # http://myorionserver.com, it won't accept an API call
      # coming from a server not hosted at same address
      # (e.g. a local installation at http://localhost)
      # This is a Cross-Origin Resource Sharing (CORS) security:
      # https://developer.mozilla.org/fr/docs/Web/HTTP/CORS
      # To make server accept CORS requests, we need to use
      # falcon-cors package: https://github.com/lwcolton/falcon-cors
      frontends_uri = (
          config["frontends_uri"]
          if "frontends_uri" in config
          else ["http://localhost:3000"]
      )
      logger.info(
          "allowed frontends: {}".format(
              ", ".join(frontends_uri) if frontends_uri else "(none)"
          )
      )
      cors = MyCORS(allow_origins_list=frontends_uri)
      super().__init__(middleware=[cors.middleware])
      self.config = config
      self.storage = storage
  
      # Create our resources
      root_resource = RuntimeResource(self.storage)
      experiments_resource = ExperimentsResource(self.storage)
      benchmarks_resource = BenchmarksResource(self.storage)
      trials_resource = TrialsResource(self.storage)
      plots_resource = PlotsResource(self.storage)
      storage_resource = StorageResource(self.storage)
  
      # Build routes
      self.add_route("/", root_resource)
      self.add_route("/experiments", experiments_resource)
      self.add_route(
          "/experiments/{name}",
          experiments_resource,
          suffix="experiment",
      )
      self.add_route("/benchmarks", benchmarks_resource)
      self.add_route(
          "/benchmarks/{name}", benchmarks_resource, suffix="benchmark"
      )
      self.add_route(
          "/experiments/status/{name}",
          experiments_resource,
          suffix="experiment_status",
      )
      self.add_route(
          "/trials/{experiment_name}",
          trials_resource,
          suffix="trials_in_experiment",
      )
      self.add_route(
          "/trials/{experiment_name}/{trial_id}",
          trials_resource,
          suffix="trial_in_experiment",
      )
      self.add_route(
          "/trials/{experiment_name}/{trial_id}/set-status/{status}",
          trials_resource,
          suffix="trial_set_status_in_experiment",
      )
      self.add_route(
          "/plots/lpi/{experiment_name}", plots_resource, suffix="lpi"
      )
      self.add_route(
          "/plots/partial_dependencies/{experiment_name}",
          plots_resource,
          suffix="partial_dependencies",
      )
      self.add_route(
          "/plots/parallel_coordinates/{experiment_name}",
          plots_resource,
          suffix="parallel_coordinates",
      )
      self.add_route(
          "/plots/regret/{experiment_name}",
          plots_resource,
          suffix="regret",
      )
      self.add_route("/dump", storage_resource, suffix="dump")
      self.add_route("/load", storage_resource, suffix="load")
      self.add_route(
          "/import-status/{name}",
          storage_resource,
          suffix="import_status",
      )
  
file_path: orion/src/orion/serving/webapi.py
imports: import logging
  import falcon
  from falcon_cors import CORS, CORSMiddleware
  from orion.serving.benchmarks_resource import BenchmarksResource
  from orion.serving.experiments_resource import ExperimentsResource
  from orion.serving.plots_resources import PlotsResource
  from orion.serving.runtime import RuntimeResource
  from orion.serving.storage_resource import StorageResource
  from orion.serving.trials_resource import TrialsResource
label_desc: Use image node_id 1 to create a new WebApi object from inherited base classes: falcon with example: obj = WebApi(storage, config)