How to define which is the current backend environment?

Thanks, you have implemented the import from Git feature. It works!

I have a related question.
I have two Appsmith servers working with the same git repo.

I have the backend_api datasource which is different depending on the server:

In the Appsmith code, I need to know what is environment used production or local?
Can I get the URL value of the backend_api datasourse?
Or maybe there is some different solution - for example, can I add a variable to docker.env and get it’s value from the Appsmith code?

Hey @ivp! Sorry for the delayed response. So the workaround here is to use different app names. I suggest you use the appsmith.URL object and figure out the name using JS function. This function will run on page load and will store the value in appsmith store using storeValue.

Thanks, I thought about this solution.

But it is not 100% true.
I can use the same Appsmith server and connect the backend_api datasource to local or production API . The appsmith.URL will be the same, but the environment will be different.

I thought maybe there is a way to extract the URL from the datasource.
As I understand we can’t do this.

If there is no a way to extract the URL from the datasource.

Probably the best solution will be to add a special backend route with information on what configuration is running (production or local).
The backend definitely knows what configuration it is running on.