dsternlicht / RESTool

RESTool is an open source UI tool for managing RESTful APIs. It could save you time developing your own internal tools. A live example:
https://dsternlicht.github.io/RESTool/
MIT License
480 stars 120 forks source link

GET method invoked but getting "load failed" in the browser #244

Open gailloue opened 11 months ago

gailloue commented 11 months ago

Hi All,

This project is exactly what I need. However, the "DEMO" link fails to load data. I tried the same method from the command line:

curl -v https://restool-sample-app.herokuapp.com/api/character/?search=

And get this error:

> GET /api/character/?search=* HTTP/1.1
> Host: restool-sample-app.herokuapp.com
> User-Agent: curl/7.68.0
> Accept: */*
>
* Mark bundle as not supporting multiuse
< HTTP/1.1 404 Not Found
...
  <body>
    <iframe src="//www.herokucdn.com/error-pages/no-such-app.html"></iframe>
  </body>

Is there any data? The no-such-app seems to indicate some other issue.

I then proceeded to create my own public/config.json with these relevant sections:

  "baseUrl": "http://52.42.5.126:5000",
...
          "dataPath": "profiles",
          "url": "/profile",

I can get data from my own daemon:

# curl -v http://52.42.5.126:5000/profile
...
{"profiles": [{"name": "us-west-2a", "thumbnail": "...220x38.png"}, {"name": "us-west-2b", "thumbnail": "...220x38.png"}]}

Note: I shortened the path the png files in the output above but checked that it's valid.

When I refresh the browser, the query is launched and data is returned but the main screen also says "load failed".

What am I missing?

dsternlicht commented 11 months ago

Hey, the free Heroku server we used is down since Heroku's free servers are no longer supported :/

Can you share a screenshot of your folder structure?

gailloue commented 11 months ago

Their entire folder structure of the git project? It's rather large. I cloned the repo and modified only config.json with the relevant changes above:

# ls
CONTRIBUTING.md  LICENSE  README.md  build  mocks.js  node_modules  npm-debug.log  nsolid_setup_deb.sh  package-lock.json  package.json  public  screenshots  src  tsconfig.json  tsconfig.lib.json
root@ip-172-31-52-158:~/RESTool# ls public
config-sample.js  config-sample.json  config.json  favicon.ico  index.html  manifest.json  restool.js  robots.txt

What can cause the "load failed"? Is it any particular json field malformed or the base URL or both? Thanks.

dsternlicht commented 11 months ago

Have you tried to run npm start?

gailloue commented 11 months ago

Yes, that's how I get the page to show up in my browser.

Maybe I wasn't clear... the "Load failed" is not the page not loading. It is the frame that normally would display the actual data that is not loading. The menu bar, title, etc, all show up but the middle of the page says "Load failed". I'm assuming that error comes from the internal parsing of the data returned by my server to the GET request.