-
Goal: I want to create a duplicate of an existing app so that I can serve it in two different places independently of each other.
-
Steps: I have tried the following two ways:
-
1] Directly clicking on ... -> "duplicate" on the apps page
-
2] Exporting app as json. Creating a new app and importing the json
-
Details: Issue is that since I want to serve both the apps separately, the REST API queries of the second app should send requests to different IP compared to the query in the first app. However, after duplicating as above, making changes to the url in one app causes the url to change in the other app too. I cannot set them independently.
Hello @shreeshail!
Very interesting, let me see if I can help.
In regards to the different IP addresses, if you are hosted on Retool Cloud, I believe you will have your REST API queries come from the same Retool server's IP address.
In regards to exporting an app, then changing the URL, could you record a video of the behavior? I just tried to reproduce this and it seems that I was able to give each app its own URL.
Are you using the 'Page Settings'->'Custom URL' option to change the URL? How are you changing the duplicate apps URL?
I just DM'd you a file with a screen recording I took of how I have a cloned app a different URL, let me know if you are able to view it
Hey @Jack_T,
By ip/url, I was referring to the url of GET/POST requests in the queries, not the url of the app itself.
It seems as if queries are global variables shared across apps. So, when I duplicate an app, the original and the duplicated app are both sharing global queries. Changing the url of a query changes it in both apps simultaneously, so it is not possible to host the backend of the two apps on two different servers.
For now, I just found a simple workaround by manually recreating new queries in the duplicate app with the same parameters (except the url) as the older queries.
Thanks.
Ahhh I see, thank you for the clarification!
Glad you were able to find a work around. I know the query library is globally scoped for sharing the same query across multiple apps.
I believe that queries are scoped to resources, and resources can be shared across apps. So if you create a query with the same resource then the base URL will be the same, I thought that since creating a new query will give it a new name that those would be unique when you append a query-specific URL to the resources base URL.
I am glad you found a workaround! It can be tricky when you have all the same query logic but need to only change the URL. Definitely check out the docs on Dynamic Queries which we recently launched that allows for a query to be duplicated and then have a unique resource set to the query!