Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix 404 issue #125

Merged
merged 2 commits into from
Mar 24, 2023
Merged

Fix 404 issue #125

merged 2 commits into from
Mar 24, 2023

Conversation

jakubnowicki
Copy link
Member

Fix 404 page not working when a non-valid page is opened as the first

Closes #124

Test application:

#Shiny Router 0.3.0 ----------
options(shiny.port = 3333)
library(shiny.router)
library(shiny)

router <- router_ui(
  route("/", shiny::tags$div(shiny::tags$span("Hello world"))),
  route("main", shiny::tags$div(h1("Main page"), p("Lorem ipsum."))),
  page_404 = page404(tags$div(tags$h1("This is the 404 Page")))
)

shinyApp(
  router,
  function(input, output, session) {router_server()}
)

# 1. Visit http://localhost:3333/#!/non-existing-page directly (without ever visiting homepage) from your browser
# 2. Visit http://localhost:3333/#!/ first and then visit http://localhost:3333/#!/non-existing-page

@jakubnowicki jakubnowicki self-assigned this Mar 24, 2023
Copy link
Member

@Gotfrid Gotfrid left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works as expected in the provided example snippet. Also, tested with a scaffolded Rhino app - works as well 💯

@jakubnowicki jakubnowicki merged commit 7ecc3d2 into main Mar 24, 2023
@jakubnowicki jakubnowicki deleted the fix-404-issue branch March 24, 2023 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Bug]: 404 page does not work when a user opens a non-valid link without going to a valid one first
2 participants