code: def test_routes_endpoint(serve_instance):
      @serve.deployment
      class D1:
          def __call__(self, *args):
              return "D1"
  
      @serve.deployment
      class D2:
          def __call__(self, *args):
              return "D2"
  
      serve.run(D1.bind(), name="app1", route_prefix="/D1")
      serve.run(D2.bind(), name="app2", route_prefix="/hello/world")
  
      routes = requests.get("http://localhost:8000/-/routes").json()
  
      assert len(routes) == 2, routes
  
      assert requests.get("http://localhost:8000/D1").text == "D1"
      assert requests.get("http://localhost:8000/D1").status_code == 200
      assert (
          requests.get("http://localhost:8000/hello/world").text == "D2"
      )
      assert (
          requests.get("http://localhost:8000/hello/world").status_code
          == 200
      )
      assert (
          requests.get("http://localhost:8000/not_exist").status_code
          == 404
      )
      assert requests.get("http://localhost:8000/").status_code == 404
  
file_path: ray/python/ray/serve/tests/test_http_routes.py
imports: import time
  import pytest
  import requests
  from fastapi import FastAPI, Request
  from starlette.responses import RedirectResponse
  import ray
  from ray import serve
  from ray.serve._private.constants import SERVE_DEFAULT_APP_NAME
label_desc: Use image node_id 3 for calling a global function with example usage: test_routes_endpoint(serve_instance) and returns: str, str