Interacting with the Terminal to run an API Gateway in the background

Hi there,

I want to create a Shiny app which interacts with an API that needs a gateway running as a background job (Interactive Brokers). Everything works fine if I run the gateway script in the terminal (mac) and send requests from the Shiny app. (Therefore, both components are run locally on the same machine at the moment)

I would like to automate the start of the gateway (and publish the app on if possible). In order to achieve this I need the following things:

  • I need to be able to interact with the terminal (mac) within the Shiny app
  • I need to be able to run a script in the background on (if this is possible)

Is there some best practice on how to do this?