-
Notifications
You must be signed in to change notification settings - Fork 1.9k
Windows Testing
Shiny applications can be tested on Windows using VMs provided by Microsoft.
In most cases, to test a Shiny application or control, one can run the application in a development server in RStudio on the host machine and access it from the VM.
The easiest way to run a Single-file Shiny App in development is with a call like shinyApp(ui = ui, server = server)
.
However, depending on the Windows VM's networking settings, the server may not be accessible.
One reliable way to connect to the host from the VM is to configure the VM to use NAT. Then, on the host, run:
shinyApp(ui = ui, server = server, options = list(host = "0.0.0.0", port = 8080))
where
-
8080
is an arbitrary but memorable port higher than 1000
Within the Windows VM, the Shiny app should be accessible at http://x.x.x.x:8080, where x.x.x.x
is the host's local network port. It should look something like 192.168.1.234
. On a Mac you can see your machine's interfaces and their addresses by running ifconfig -a
in a terminal.
One control that isn't necessarily well-behaved is fileInput
. This control only works for Internet Explorer versions 9 and below when the application that uses it is running on Shiny Server or RStudio Connect
("RSC").
- First, configure
Global Options > Publishing
to add your RSC server as a publishing option. For details on this see the User Guide section after logging into RSC with your browser. - Commit your Shiny changes on a branch.
- Push the changes to GitHub.
- Run
devtools::install_github("user/shiny@branchname")
whereuser
is a GitHub name or organization andbranchname
is the branch with changes. - Deploy the app with the Publish button.
Please see the Running development version of Shiny in Shiny Server in Docker document.