I am trying to run a shiny app in Rstudio as a background job. Whenever I do, it ignores my host/post settings and defaults to local host / 127.0.0.1. Is there another way I need to be calling my app for this to work?
If you like to run it as a background job, you have to write a separate script that calls the app with runApp. So you write the app as you normally would (don't set any options), then write another script (that you submit as the job) that calls the app with the specific host and port settings like this:
library(shiny)
#The path is to the folder, not the app file (app should be called app.R or server.R/ui.R)
runApp("pathToShinyAppFolder/", launch.browser = T, host = "127.0.0.1", port = 1234)
This app is hosted on your local machine, so any other IP you set apart from your own won't work I think. As noted in the documentation: To allow other clients to connect, use the value "0.0.0.0" instead.