Streamlit custom component, flask issue

Inside my My component.tsk file, I have have attached a flask api too it , that helps me get a dropdown in input box. I am only able to search through items on my own system,while the other people on the server cant search through the items.

  private searchQuery = (name: string) : void => {
    console.log(name)
  }

  private handleInputChange = (e: any) : void => {
    this.setState(
            {query: e.target.value},
    )
    fetch("http://127.0.0.1:5000/search?term=" + e.target.value)
        .then(res => res.json())
        .then(
            (result) => {
                this.setState({optionsData:result})
            }
        )
  }

This is how I am accessing my component, in my main streamlit file

if not _RELEASE:
    _component_func = components.declare_component(
        # We give the component a simple, descriptive name ("my_component"
        # does not fit this bill, so please choose something better for your
        # own component :)
        "my_component",
        # Pass `url` here to tell Streamlit that the component will be served
        # by the local dev server that you run via `npm run start`.
        # (This is useful while your component is in development.)
        url="http://localhost:3001",

This on my own local system


I cant get the same result on the server

url=“http://localhost:3001”,

The issue was here, I should have posted the server link, not the local host link