Skip to content

feat: wire Rust HTTP server into CLI with tests (#45) - #47

Merged
zackees merged 2 commits into
mainfrom
feat/wire-rust-server
Apr 12, 2026
Merged

zackees merged 2 commits into
mainfrom
feat/wire-rust-server

Conversation

@zackees

@zackees zackees commented Apr 12, 2026

Copy link
Copy Markdown
Member

Summary

Wire the axum-based Rust HTTP server into the CLI. The --serve-dir flag now uses the native Rust server instead of delegating to Python/Flask.

TDD approach

8 integration tests prove the server works:

  • Loading page when index.html missing (compilation in progress)
  • Serves index.html when present
  • JS files with text/javascript MIME type
  • WASM files with application/wasm MIME type
  • COOP/COEP security headers on all responses
  • 404 for missing files
  • build-status.json served from disk (for live build streaming)
  • Directory traversal blocked

Changes

  • server.rs: Remove dead_code allow, add 8 tests
  • main.rs: Wire --serve-dir to server::start_server(), add open_browser() helper
  • 55 Rust + 121 Python tests pass

Ref #45

zackees added 2 commits April 12, 2026 05:05
- Remove dead_code allow, server module is now used
- Wire --serve-dir to use the Rust axum server natively (no Flask)
- Add 8 integration tests proving: loading page, static file serving,
  MIME types, COOP/COEP headers, build-status.json, 404, dir traversal
- Add open_browser() helper for cross-platform browser launch

55 Rust tests + 121 Python tests pass.
@zackees
zackees merged commit 2f6806f into main Apr 12, 2026
25 checks passed
@zackees
zackees deleted the feat/wire-rust-server branch April 12, 2026 12:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant