code: def test_flow_expose_endpoints():
      f1 = Flow(
          protocol="http",
          no_debug_endpoints=True,
          no_crud_endpoints=True,
      ).add(uses=MyExec)
      import requests
  
      with f1:
          r = requests.get(f"http://localhost:{f1.port}/foo")
      assert r.status_code == 404
  
      f1.expose_endpoint("/foo")
      with f1:
          r = requests.post(
              f"http://localhost:{f1.port}/foo",
              json={"data": [{"text": "hello"}, {"text": "world"}]},
          )
      assert r.status_code == 200
  
file_path: jina/tests/unit/orchestrate/flow/flow-orchestrate/test_flow_http_extend.py
imports: import pytest
  from jina import Executor, requests, Flow
  from jina.excepts import BadClient
label_desc: Use image node_id 2 for calling a global function with example usage: test_flow_expose_endpoints() without return types