Split deployment page into local and web

Also add info about runGitHub and runUrl
This commit is contained in:
Winston Chang
2013-01-24 14:57:59 -06:00
parent 98b0be86b1
commit 68c2ba441a
4 changed files with 135 additions and 80 deletions

View File

@@ -0,0 +1,87 @@
## Sharing Apps to Run Locally
Once you've written your Shiny app, you can distribute it for others to run on their own computers—they can download and run Shiny apps with a single R command. This requires that they have R and Shiny installed on their computers.
If you want your Shiny app to be accessible over the web, so that users only need a web browser, see <a href="#deployment-web">Deploying Shiny Apps over the Web</a>.
Here are some ways to deliver Shiny apps to run locally:
### Gist
One easy way is to put your code on [gist.github.com](https://gist.github.com), a code pasteboard service from [GitHub](https://github.com/). Both server.R and ui.R must be included in the same gist, and you must use their proper filenames. See [https://gist.github.com/3239667](https://gist.github.com/3239667) for an example.
Your recipient must have R and the Shiny package installed, and then running the app is as easy as entering the following command:
<pre><code class="r">shiny::runGist('3239667')</code></pre>
In place of `'3239667'` you will use your gist's ID; or, you can use the entire URL of the gist (e.g. `'https://gist.github.com/3239667'`).
#### Pros
* Source code is easily visible by recipient (if desired)
* Easy to run (for R users)
* Easy to post and update
#### Cons
* Code is published to a third-party server
### GitHub repository
If your project is stored in a git repository on GitHub, then others can download and run your app directly. An example repository is at [https://github.com/rstudio/shiny_example](https://github.com/rstudio/shiny_example). The following command will download and run the application:
<pre><code class="r">shiny::runGitHub('shiny_example', 'rstudio')</code></pre>
In this example, the GitHub account is `'rstudio'` and the repository is `'shiny_example'`; you will need to replace them with your account and repository name.
#### Pros
* Source code is easily visible by recipient (if desired)
* Easy to run (for R users)
* Very easy to update if you already use GitHub for your project
* Git-savvy users can clone and fork your repository
#### Cons
* Developer must know how to use git and GitHub
* Code is hosted by a third-party server
### Zip File, delivered over the web
If you store a zip or tar file of your project on a web or FTP server, users can download and run it with a command like this:
<pre><code class="r">runUrl('https://github.com/rstudio/shiny_example/archive/master.zip')</code></pre>
The URL in this case is a zip file that happens to be stored on GitHub; replace it with the URL to your zip file.
#### Pros
* Only requires a web server for delivery
#### Cons
* To view the source, recipient must first download and unzip it
### Zip File, copied to recipient's computer
Another way is to simply zip up your project directory and send it to your recipient(s), where they can unzip the file and run it the same way you do (`shiny::runApp`).
#### Pros
* Share apps using e-mail, USB flash drive, or any other way you can transfer a file
#### Cons
* Updates to app must be sent manually
### Package
If your Shiny app is useful to a broader audience, it might be worth the effort to turn it into an R package. Put your Shiny application directory under the package's `inst` directory, then create and export a function that contains something like this:
<pre><code class="r">shiny::runApp(system.file('<em>appdir</em>', package='<em>packagename</em>'))</code></pre>
where `appdir` is the name of your app's subdirectory in `inst`, and `packagename` is the name of your package.
#### Pros
* Publishable on CRAN
* Easy to run (for R users)
#### Cons
* More work to set up
* Source code is visible by recipient (if not desired)

View File

@@ -0,0 +1,31 @@
## Deploying Over the Web
Once you've written your Shiny app, you can make it available to anyone who has a web browser, using our Shiny Server software. You can either host the applications on your own server, or let us host your Shiny applications for you.
If you want a simple way to distribute your Shiny app so that users can run them on their own computers, see <a href="#deployment-local">Deploying Shiny Apps to Run Locally</a>.
### Self-hosted Shiny Server
With our [Shiny Server](https://github.com/rstudio/shiny-server) software, you can deploy Shiny applications over the web so that users need only a web browser and your application's URL. You'll need a Linux server and [Shiny Server](https://github.com/rstudio/shiny-server).
Shiny Server is free and open source, though in the future we will offer a commercially licensed edition with additional features for larger organizations. If you'd like to be notified of future beta releases of Shiny Server, please [register now](https://rstudio.wufoo.com/forms/shiny-server-beta-program/).
#### Pros
* Easiest for your users&mdash;only a web browser is required
* Take advantage of centralized computing resources
#### Cons
* Requires server setup and maintenance of a Linux server
### RStudio-hosted Shiny Server
Want to deploy over the web but prefer not to run your own server? We're currently beta testing a subscription-based hosting service for Shiny. To apply for a free beta test account, [register now](https://rstudio.wufoo.com/forms/shiny-server-beta-program/).
#### Pros
* Easiest for your users&mdash;only a web browser is required
* No need to run your own server
#### Cons
* Code and data must be copied to our servers

View File

@@ -1,74 +0,0 @@
## Delivering Shiny Apps
Once you've written your Shiny app, tested it locally, and gotten it working just right, chances are you're going to want to share your work with others.
You have several options:
### Gist
One easy way is to put your code on [gist.github.com](https://gist.github.com), a code pasteboard service from [GitHub](https://github.com/). Both server.R and ui.R must be included in the same gist, and you must use their proper filenames. See [https://gist.github.com/3239667](https://gist.github.com/3239667) for an example.
Your recipient must have R and the Shiny package installed, and then running the app is as easy as entering the following command:
<pre><code class="r">shiny::runGist('3239667')</code></pre>
In place of `'3239667'` you will use your gist's ID; or, you can use the entire URL of the gist (e.g. `'https://gist.github.com/3239667'`).
#### Pros
* Source code is easily visible by recipient (if desired)
* Easy to run (for R users)
* Easy to post and update
#### Cons
* Code is published to a third-party server
### Zip File
Another way is to simply zip up your project directory and send it to your recipient(s), where they can unzip the file and run it the same way you do (`shiny::runApp`).
#### Pros
* Share apps using e-mail, USB flash drive, or any other way you can transfer a file
#### Cons
* Updates to app must be sent manually
### Package
If your Shiny app is useful to a broader audience, it might be worth the effort to turn it into an R package. Put your Shiny application directory under the package's `inst` directory, then create and export a function that contains something like this:
<pre><code class="r">shiny::runApp(system.file('<em>appdir</em>', package='<em>packagename</em>'))</code></pre>
where `appdir` is the name of your app's subdirectory in `inst`, and `packagename` is the name of your package.
#### Pros
* Publishable on CRAN
* Easy to run (for R users)
#### Cons
* More work to set up
* Source code is visible by recipient (if not desired)
### Over the web (self hosted)
You can deploy Shiny applications over the web, so that users need only a web browser and your application's URL. You'll need a Linux server and our [Shiny Server](https://github.com/rstudio/shiny-server) software.
Shiny Server is free and open source, though in the future we will offer a commercially licensed edition with additional features for larger organizations. If you'd like to be notified of future beta releases of Shiny Server, please [register now](https://rstudio.wufoo.com/forms/shiny-server-beta-program/).
#### Pros
* Easiest for your users&mdash;only a web browser is required
* Take advantage of centralized computing resources
#### Cons
* Requires server setup and maintenance of a Linux server
### Over the web (RStudio hosted)
Want to deploy over the web but prefer not to run your own server? We're currently beta testing a subscription-based hosting service for Shiny. To apply for a free beta test account, [register now](https://rstudio.wufoo.com/forms/shiny-server-beta-program/).
#### Pros
* Easiest for your users&mdash;only a web browser is required
* No need to run your own server
#### Cons
* Code and data must be copied to our servers

View File

@@ -177,9 +177,12 @@ hljs.initHighlightingOnLoad();
<li>
<a target="_self" href="#dynamic-ui">Dynamic UI</a>
</li>
<li class="nav-header">Sharing Apps</li>
<li class="nav-header">Deploying and Sharing Apps</li>
<li>
<a target="_self" href="#deployment">Delivering Shiny Apps</a>
<a target="_self" href="#deployment-web">Deploying Over the Web</a>
</li>
<li>
<a target="_self" href="#deployment-local">Sharing Apps to Run Locally</a>
</li>
<li class="nav-header">Extending Shiny</li>
<li>
@@ -309,11 +312,19 @@ hljs.initHighlightingOnLoad();
</div>
<!-- Delivering Shiny Apps -->
<div class="tab-pane" id="deployment">
<!-- Deploying Shiny Apps Over the Web -->
<div class="tab-pane" id="deployment-web">
{% capture deployment %}{% include tutorial/deployment.md %}{% endcapture %}
{{ deployment | markdownify }}
{% capture deployment_web %}{% include tutorial/deployment-web.md %}{% endcapture %}
{{ deployment_web | markdownify }}
</div>
<!-- Sharing Apps to Run Locally -->
<div class="tab-pane" id="deployment-local">
{% capture deployment_local %}{% include tutorial/deployment-local.md %}{% endcapture %}
{{ deployment_local | markdownify }}
</div>