For the web app, use path-based routing instead of hash-based routing #136
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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-routerto handle the routing (it was already bundled, but it was unused) and we serveindex.htmlinstead of a 404 page.IncterceptHtml.csnow (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."%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.The
<base>tag is supported by all major browsers: https://developer.mozilla.org/en-US/docs/Web/HTML/Reference/Elements/baseTested on Chrome, Firefox, and Safari.