Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@jackbuehner
Copy link
Collaborator

This PR switches RAWeb from hash-based (e.g. #favorites, #settings) to path-based (/favorites, /settings) routing and URLs. This is possible because we now use vue-router to handle the routing (it was already bundled, but it was unused) and we serve index.html instead of a 404 page.

  • IncterceptHtml.cs now (1) serves a static file if it exists, (2) quits early if it detects a path to the API so that the API is not affected, (3) attempts to serve an HTML file with token replacement if it exists, and (4) serves index.html with token replacement if conditions 1-3 were not met. In effect, it replaces non-API 404 pages with index.html. This is common for a single-page app (SPA) like ours.
  • HTML token replacement now includes replacing "%raweb.basetag%" with <base href=\"" + VirtualPathUtility.ToAbsolute("~/") + "\" />, so that paths consistently resolve relative to the path to which RAWeb is installed. This is needed when subpaths may be served index.html.
  • There is now a 404 page on the web app since the web app now receives all URLs that would have been 404 errors on the app.

The <base> tag is supported by all major browsers: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/base

Tested on Chrome, Firefox, and Safari.

@jackbuehner jackbuehner self-assigned this Sep 22, 2025
@jackbuehner jackbuehner added the enhancement New feature or request label Sep 22, 2025
@jackbuehner jackbuehner merged commit e10f556 into kimmknight:master Sep 22, 2025
@jackbuehner jackbuehner deleted the non-hash-routing branch September 22, 2025 22:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant