mirror of
https://github.com/runbear-io/beardrive.git
synced 2026-08-25 08:08:08 +02:00
Replace the frontend's hash-based routing with the History API and real `/` paths, so URLs read like native file paths: /#p-4e61c7d4/shared%2Fidea.md -> /p-4e61c7d4/shared/idea.md /#shared%2Fnotes.md -> /shared/notes.md (volume mode) /#join/<token> -> /join/<token> Client (app.js): - parseRoute() reads location.pathname; pushURL/syncURL push native paths (segments percent-encoded, "/" kept literal); a popstate handler restores back/forward. Invites read from /join/<token>. - All api/ fetches and the app.js/style.css refs are now root-absolute so a deep path doesn't break relative URL resolution. Server (server.go): - New Server.frontend handler: real assets serve directly; every other non-API/auth/share GET returns index.html (SPA fallback), so deep links and refreshes resolve instead of 404ing. Reserved prefixes stay 404s. - Invite links minted as /join/<token> (orgs.go). Tests: TestFrontendSPAFallback covers the fallback + reserved-prefix 404s; existing invite test updated. Verified end to end in the running hub (deep-link reload, back/forward, no %2F/# in the bar). Docs updated. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01R7Q9ZKSZRTdvrSJkYLUmYs