Public url of DEV APP

Hi
I have APPS that are published under a custom public domain like https://my-cool-app.anvil.app/
Then, I make modifications and need to give an external tester access to the DEV version (not the published one), so to click “Publish” when tested.
Is there a way to get the address of the DEV version of the APP?
I think I read it somwhere, in the forums of in the docs, but can’t find it.
Thanks

I don’t think so. You might be thinking of this suggestion to create a separate app for development/testing? Anvil Docs | Apps in development and production

You can make a clone app for testers, modify the original for changes and clone again

1 Like

Hi @hugetim and @Tony.Nguyen and thanks for your answers.
I currently have 2 separate versions of the app, one for DEV-TEST and one for PROD.
But I don’t know git well and was looking for a way to avoid learning it :sweat_smile:
I was looking for a web-ide built-in way to do that.
I can keep versions aligned without git quite easily with source code, but it is really unefficient and error-prone when it comes to changes in the UI and design-time properties.
Only the code-level YAML file alignment “powered by git” can make sure the hundreds of small UI modifications are correctly pushed to PROD.

So, to me, it would be an interesting functionality if the APP exposed an URL where the DEV APP (the same you browse when you click “Play” button in IDE), with unpublished changes, is run.
This way you just need 1 APP to DEV/TEST/PROD and 1 click (“Publish”) to have all aligned.
What you lose is, basically, the chance to differentiate DEV and TEST.

But the bad news is: if this is not yet available as a functionality, by the time the new functionality request gets even taken into consideration, I’ll git blackbelt. :pensive:

However, thanks!
BR

The link Tim posted about using local git repos to keep a PROD app up to date doesn’t require too much in the way of git lore. If you’re working your way through it and have issues, let us know. Lots of folks here use that setup.

I will note that if you did have a single app that used the published status to differentiate between TEST and PROD versions, TEST and PROD would share the same data table contents, which generally isn’t what you want. The two app setup is really needed to isolate PROD data table contents from any DEV or TEST changes.

2 Likes

Hi @jshaffstall

Yes that’s true.
Then Git is practically mandatory unless changes are really few.

Ooh, it turns out there is potentially a way to do what you originally wanted, @aldo.ercolani: Allow to run development version on its own window

2 Likes

Thanks @hugetim that is what I was looking for!

1 Like

Just an update.
Maybe I found another, more “usable” way to do that.
You could make your DEV app print (or set the URL of a link component to) its anvil.server.get_app_origin().

I noticed the difference between the two URL is that $("iframe")[0].src has this suffix:
<app_origin>/_/debug?requestTime=1627111324592 (or another number)

But I don’t think this is mandatory, the simple app origin works well for me.

1 Like

Bump here.
I noticed the URL exposed by anvil.server.get_app_origin() for my DEV (unpublished) APP has changed.
What I do: in my APP I test if what’s running is the debug version or not by:

self.test_app = str(anvil.server.get_app_origin()).find('debug') > 0

and if that’s TRUE I print out a link to the test app URL anvil.server.get_app_origin() and activate some debugging messages.
I shared this URL with testers some time ago (Aug 10th) and today I notice the same instruction prints out a different URL, e.g.:

# 10 Aug URL
https://gglftz6fxxcdge4m.anvil.app/debug/3ODCK77F3QPXODFAFD2UG6XD447DGCJG%3DRGLT7REM6SYUU6GK2GAXNMZQ
# Today URL
https://gglftz6fxxcdge4m.anvil.app/debug/WW27QRENMUTBJGGYISZPTL3STRW75H65%3DVMUSZY3DR26DMGTZ4JBX3NEF

Is that a behaviour by design? Should I avoid sharing that URL at all, since it can unpredictably change?

Thanks

My guess is that unless/until it’s documented or shown in the IDE (as requested here), it should be considered “subject to change” / “use at your own risk.”

2 Likes

Yes I agree, I just asked for some insights about the URLs geenrated by anvil.server.get_app_origin()

1 Like