code: def create_app(client_port: int = 5559, modules_name: list = []):
      """
      Start one flask instance and ready for HTTP requests.
  
      Args:
           client_port(str): port of zmq backend address
           modules_name(list): the name list of modules
  
      Returns:
          One flask instance.
  
      Examples:
          .. code-block:: python
  
              create_app(client_port='5559')
      """
      app_instance = Flask(__name__)
      app_instance.config["JSON_AS_ASCII"] = False
      app_instance.logger = log.get_file_logger(filename)
      pid = os.getpid()
  
      @app_instance.route("/", methods=["GET", "POST"])
      def index():
          """
          Provide index page.
          """
          return (
              "暂不提供可视化界面，请直接使用脚本进行请求。<br/>No visual "
              "interface is provided for the time being, please use the"
              " python script to make a request directly."
          )
  
      @app_instance.before_request
      def before_request():
          """
          Add id info to `request.data` before request.
          """
          request.data = {
              "id": utils.md5(request.remote_addr + str(time.time()))
          }
  
      @app_instance.route("/predict/<module_name>", methods=["POST"])
      def predict_serving_v3(module_name: str):
          """
          Http api for predicting.
  
          Args:
              module_name(str): Module name for predicting.
  
          Returns:
              Result of predicting after packaging.
          """
  
          if module_name not in modules_name:
              msg = "Module {} is not available.".format(module_name)
              return package_result("111", "", msg)
          inputs = request.json
          if inputs is None:
              results = (
                  "This usage is out of date, please use 'application/json' as content-type to post to /predict/%s. See 'https://github.com/PaddlePaddle/PaddleHub/blob/release/v1.6/docs/tutorial/serving.md' for more details."
                  % (module_name)
              )
              return package_result("112", results, "")
          inputs = {"module_name": module_name, "inputs": inputs}
          port_str = "tcp://localhost:%s" % client_port
  
          client = InferenceClientProxy.get_client(pid, port_str)
  
          results = client.send_req(inputs)
  
          return package_result("000", results, "")
  
      return app_instance
  
file_path: PaddleHub/paddlehub/serving/http_server.py
imports: import time
  import os
  import multiprocessing
  import platform
  from flask import Flask, request
  from paddlehub.serving.device import InferenceServer
  from paddlehub.serving.client import InferenceClientProxy
  from paddlehub.utils import utils, log
label_desc: Use image node_id 2 for calling a global function with example usage: create_app(client_port, modules_name) and returns: app_instance, str, package_result, package_result, package_result