fix(api+frontend): harden SPA catch-all routing, tests, and dev script cleanup#34
Merged
Olino3 merged 2 commits intofeature/angular-scaffoldfrom Mar 20, 2026
Merged
Conversation
6 tasks
…ts, and dev script Co-authored-by: Olino3 <119822419+Olino3@users.noreply.github.com> Agent-Logs-Url: https://github.com/Olino3/LEDMatrix/sessions/44266a2b-7656-48a9-a014-187d907fb629
Copilot
AI
changed the title
[WIP] Scaffold Angular 21 project with FastAPI serving
fix(api+frontend): harden SPA catch-all routing, tests, and dev script cleanup
Mar 20, 2026
Olino3
approved these changes
Mar 20, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Addresses all review comments from PR #33 on the Angular SPA serving implementation.
src/api/main.pyspa_dist_dir/favicon.icowhen present; fall back to 204.spa_dist_dircomputed before the favicon route to enable this./api/→/api— closes the gap where bare/apior/api/v3bypassed the check.".." not in full_pathwithPath.resolve()+relative_to()— properly rejects any path escapingspa_dist_dir.mimetypes.guess_type()—.js/.cssmissing files return 404, but valid Angular routes like/user/john.doestill fall through toindex.html.read_text()+HTMLResponsewithFileResponse./v3redirect: added explicitGET /v3 → 307 /v3/inside the SPA block — the catch-all was preventing Starlette'sredirect_slashesfrom firing for this path.HTMLResponseimport.test/test_api_spa_mount.py/api/v3/system/status; addedstatus == 200andcontent-type: application/jsonassertions.follow_redirects=False+ assertstatus == 307(previously the test passed vacuously — the catch-all was returning 404, not the real route).test_spa_catch_all_does_not_intercept_bare_apiandtest_spa_missing_asset_returns_404.frontend/src/app/app.spec.ts<router-outlet />, not an<h1>.scripts/dev/run_frontend_dev.shcleanup(): replacedkill 0(kills entire process group) with a targeted loop thatkills thenwaits each captured PID.⚡ Quickly spin up Copilot coding agent tasks from anywhere on your macOS or Windows machine with Raycast.