fix SPA routing for Dioxus client-side navigation #15

Closed
mik-tf wants to merge 1 commit from development_spa_fix into development
Owner

Changes

  • Serve /assets/* and /hero_os_http/assets/* explicitly via ServeDir
  • Use fallback_service(ServeFile::new(index.html)) for all unmatched paths
  • Enables Dioxus HTML5 pushState routing to work on page refresh and direct navigation

Testing

  • Deployed to TFGrid VM (heroos.gent02.grid.tf) and verified SPA loads on all routes
  • Verified WASM assets still load correctly at both /assets/* and /hero_os_http/assets/*
  • Login page renders and authentication flow works end-to-end

Closes #14

## Changes - Serve `/assets/*` and `/hero_os_http/assets/*` explicitly via `ServeDir` - Use `fallback_service(ServeFile::new(index.html))` for all unmatched paths - Enables Dioxus HTML5 pushState routing to work on page refresh and direct navigation ## Testing - [x] Deployed to TFGrid VM (`heroos.gent02.grid.tf`) and verified SPA loads on all routes - [x] Verified WASM assets still load correctly at both `/assets/*` and `/hero_os_http/assets/*` - [x] Login page renders and authentication flow works end-to-end Closes #14
fix: SPA routing for Dioxus client-side navigation
Some checks failed
Build and Test / test (pull_request) Failing after 4m19s
91790449fe
hero_os_http was returning 404 for Dioxus client-side routes like /login
because ServeDir only serves existing files. Changed to:
- Serve /assets/* from the assets subdirectory (not root)
- Serve /hero_os_http/assets/* for proxy-prefixed requests
- Fallback all other paths to index.html for SPA routing

This ensures browser refreshes and deep links work correctly both
in direct mode (port 8804) and behind hero_proxy.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
mik-tf changed title from WIP: fix SPA routing for Dioxus client-side navigation to fix SPA routing for Dioxus client-side navigation 2026-02-28 15:25:08 +00:00
Author
Owner

Superseded by consolidated PR #19 which includes SPA routing via ServeDir::fallback(ServeFile) — same fix, different approach.

Superseded by consolidated PR #19 which includes SPA routing via ServeDir::fallback(ServeFile) — same fix, different approach.
mik-tf closed this pull request 2026-03-02 12:55:34 +00:00
Some checks failed
Build and Test / test (pull_request) Failing after 4m19s

Pull request closed

Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
lhumina_code/hero_os!15
No description provided.