createWebHistory with base "/". The Go server already falls back to index.html for any unmatched path and [web] has no path-prefix option, so the dashboard is always at the root. legacy-hash-redirect.ts rewrites `#/path` links minted before this change. Verified against archie-ui rather than the Vite dev server: /tasks, /tasks/42 and /settings all serve index.html with assets resolving, and #/settings lands on /settings.
8 lines
221 B
TypeScript
8 lines
221 B
TypeScript
// Rewrites a legacy `#/path` URL to `/path`.
|
|
const legacy = window.location.hash;
|
|
|
|
if (legacy.startsWith("#/")) {
|
|
const path = legacy.slice(1);
|
|
window.history.replaceState(null, "", path + window.location.search);
|
|
}
|