Adding a separate index.html as homepage and routing shinyapp to some other page

Viewed 752

I have made a shiny app in R and hosted it over the web using shiny-server. Let's say my app is hosted at www.test.in (just for instance). Now I want to add a simple static HTML page which will contain the link of the app so when the user will visit the URL www.test.in, he will see the HTML page and www.test.in/app will contain the shiny app.

Thanks in advance.

1 Answers

You could add following index.html file in /srv/shiny-server:

index.html

<!DOCTYPE html>
<html>
  <head>
    <meta http-equiv="Refresh" content="0; url=//www.test.in:port/app/" />
  </head>
  <body>
    <p>Redirecting to <a href="//www.test.in:port/app/">app</a>.</p>
  </body>
</html> 

where port should be set to the correct value, for example 3838.
Shiny Server will open this index and redirect to the app.

Related