When I deploy an app on app platform it gets a public url like panda-app-999zz.ondigitalocean.app/
. Is there a programmatic way for the app itself to get this url?
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Hi Jdoleary,
You can configure an environment variable of your choosing for the App and assign it to the bindable variable.
For example, if you set your environment variable URL to the value ${APP_URL} inside your app, the variable URL will have the value for the public URL. If you later assign one or more custom domains to the app, the variable will contain the domain marked as primary.
You can also get the domain only without http by using ${APP_DOMAIN} instead.
See this docs on how to configure environment variables and what other bindable variables are available.
Best, Moises