Hello RStudio Community!
My work environment has a dev and prod for RSSP (RStudio Server Peo) and RSC (RStudio Connect). Based on dev and prod there are different steps depending on which environment we are in. I am looking for a way to detect the environment automatically so the developer does not need to manually specify it. The approach I am taking currently with shiny apps is to look at session$clientData$url_hostname
. This is perfect because I can detect if its the dev or prod URL. However, I am looking for a solution for R scripts and Rmd's. Is there a way to get the URL of the current R session for RSSP?
The only thing I can find that is remotely close at the moment is if the Rmd is hosted on RSC then there are environment variables created that I can reference. This does get me to my end goal when the Rmd is hosted. I am curious if there a way to get the local RStudio Server URL, or in general a different approach to automatically knowing if I'm in dev or prod for RSSP/RSC. I am hoping there is a function I am missing that is similar to sessionInfo()
that makes this easily accessible
Thanks!