Can a plumbr api know it is running from Rstudio connect rather than interactively on my rstudio server pro?

I have a bunch of lines I need to comment/uncomment when I switch between running from the API on my rstudio server pro session to running the API on Rstudio connect.

These comments are mostly regarding where/how I am saving the logs.

Is there a way for R to know what runs it? Maybe interactive() ?