[Beta] Http endpoints and environments

How do I test http endpoints in the new beta editor?

There is a Get a link to my development environment link at the bottom of the Publish this app dialog, but… it’s confusing. I can get links to all the features from inside the environment settings, but I need to click there and create a new environment to get a link to the current environment???

I noticed that:

  • The documentation for http endpoints in the classic and beta editor is identical. Is the new documentation still work in progress, or is it supposed to be identical?
  • The URL advertised at the bottom of a server module doesn’t work (bug?):
    image
  • If I run the app from the IDE in its own tab, then I add /_/api/test_http_endpoint to the url, the http endpoints work in the current environment

I guess this last point answers my question. Now I can test my http endpoints.
But I would still like some clarification on this subject.

This is exactly what the “Get a link to my development environment” link is for! It gives you a URL that will access whatever version of the app you currently have open in the editor. You can use it to open the app in a browser, or to access HTTP endpoints as you’re editing them.

(Of course, you can do this by hand if you want - you could create a new environment and point it at the branch you’re currently editing, and move it if you switch to editing another branch. The development environment just automates this for you!)

The relevant docs are here:

I had seen that page, but I ignored it because in my case I already have two environments: Published associated to the master branch and Development associated to the dev branch.

Each environment has its own uplink key, so I assumed each environment has its own api url, and I assumed I would find that api url here:
image

But editing both branches shows the same url, and using that url says No matching API endpoint.

While adding /_/api to the app url shown in the Publish this app works.

The API URL is derived, as you say, by adding /_/api to the end of any environment’s URL. The feature request for making the yellow bar in the code editor smarter is duly noted :slight_smile: (It, like the Scheduled Tasks config, should know what branch you’re on and what URL[s] point to that branch)

2 Likes