Failure to display dynamic information from the database in fancytree

I entered fancyTree into apex and when I use static data, the tree is displayed well, but I want the data to be displayed from the database, and for this I created a restful api that outputs json, but when the url is displayed in the field I put javascript, it doesn’t show anything! Why is it like that? What should I do to fix it?

This is my javascript code:

    $("#tree1").fancytree({
  checkbox: true,
  selectMode: 3,
  source: {
    url:
      "http://localhost:5080/ords/test/fancyTree/api"
  },
   lazyLoad: function(event, data) {
    data.result = {url: "http://localhost:5080/ords/test/fancyTree/api"};
  }, 
});

This is a simple query:

select 
    id as key
    ,code ||'-' || name as title
from  vE5ProcessTreeLight 
start with id=15095794414151206135  connect by   nocycle prior id=  parent_id
order siblings by eqptype,name