【问题标题】:Adding a separate index.html as homepage and routing shinyapp to some other page添加一个单独的 index.html 作为主页并将 shinyapp 路由到其他页面
【发布时间】:2020-12-22 15:03:43
【问题描述】:

我在 R 中制作了一个闪亮的应用程序,并使用闪亮服务器将其托管在网络上。假设我的应用程序托管在www.test.in(例如)。现在我想添加一个简单的静态 HTML 页面,其中将包含应用程序的链接,因此当用户访问 URL www.test.in 时,他将看到 HTML 页面,www.test.in/app 将包含闪亮的应用程序。

提前致谢。

【问题讨论】:

    标签: r shiny shiny-server


    【解决方案1】:

    您可以在/srv/shiny-server 中添加以下index.html 文件:

    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> 
    

    port 应设置为正确的值,例如 3838。
    Shiny Server 将打开此索引并重定向到应用程序。

    【讨论】:

    • 感谢您的回答,但没有奏效。 /srv/shiny-server 将 app.R 作为它的索引页面而不是 index.html,所以我没有发现任何更改。
    • 通常应用在应用名称对应的/srv/shiny-server的子目录中。只需将索引放在/srv/shiny-server 的根目录下即可。
    猜你喜欢
    • 2019-02-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2020-10-06
    • 1970-01-01
    • 2021-06-08
    • 1970-01-01
    相关资源
    最近更新 更多