Skip to content

Cannot use base url in multi-app export, edit link also broken #154

@khusmann

Description

@khusmann

When exporting multiple apps to the same destdir (via subdir, see #59), the result does not let me use the base url (e.g. example.com/app1); instead I need to navigate directly to the index.html file (e.g. example.com/app1/index.html).

Here's a how to reproduce:

shinylive::export("src/app1", "build", subdir = "app1")
shinylive::export("src/app2", "build", subdir = "app2")
httpuv::runStaticServer("build")

Then navigating to http://127.0.0.1:7446/app1/index.html will work, but navigating to http://127.0.0.1:7446/app1 fail because it 404s trying to load "app.json".

The reason for this is that shinylive.js attempts to load "./app.json", which is http://127.0.0.1:7446/app1/app.json when index.html is in the URL, but then incorrectly http://127.0.0.1:7446/app.json when the url does not have the index.html.

A similar problem is with the edit links -- http://127.0.0.1:7446/app1/edit redirects to http://127.0.0.1:7446/index.html?_shinylive-mode=editor-terminal-viewer instead of http://127.0.0.1:7446/app1/index.html?_shinylive-mode=editor-terminal-viewer

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions