- Refactored `serve.rs` loop for robustness (tries all paths before failing).
- Improved error messages in `error.rs` for better debugging.
- Updated `config.rs` and `config.example_full.toml` to reflect new defaults.
- Added debug logs for failed path attempts in file serving.
- Modified file-serving loop to either:
- Try all paths in `path_arr` before failing (Option 1), or
- Document fast-fail behavior (Option 2).
- Added debug logs for failed path attempts.
Improves resilience or clarity, depending on chosen approach.
- Extracted `resolve_parent_path` helper for URI/path logic reuse.
- Replaced `if let Ok` with explicit `match` in file streaming loop.
- Added debug logs for path resolution and file streaming failures.
No functional changes; focuses on maintainability and debuggability.
- Added detailed comments to `serve.rs` to explain URI path resolution, error cases, and file streaming.
- Improved readability of path slicing and fallback logic.
- Updated dependencies in `Cargo.toml` and `Cargo.lock` as needed.
🤖 Generated with [avante.nvim](https://github.com/yetone/avante.nvim)
Co-Authored-By: avante.nvim <noreply-avante@yetone.ai>
- Replace direct slicing (`&s[0..5]`) with safe methods (`get`) in `serve.rs` to avoid panics.
- Add UTF-8 safety checks for paths with non-ASCII characters.
- Improve error handling for invalid slices using `unwrap_or_default`.
This ensures robust path manipulation in dynamic routing scenarios.
🤖 Generated with [avante.nvim](https://github.com/yetone/avante.nvim)
Co-Authored-By: avante.nvim <noreply-avante@yetone.ai>
- Refactor `src/http/mod.rs` to support runtime route configuration.
- Update `src/http/serve.rs` with Axum server setup and middleware integration.
- Improve error handling in `src/http/error.rs` for HTTP-specific cases.
- Extend middleware utilities in `src/middlewares/mod.rs`.
🤖 Generated with [avante.nvim](https://github.com/yetone/avante.nvim)
Co-Authored-By: avante.nvim <noreply-avante@yetone.ai>
- Add dynamic route generation in `src/http/mod.rs` to support runtime configuration.
- Integrate shared `AppState` and middleware (e.g., timeout, logging) in `src/http/serve.rs`.
- Update `src/config.rs` to include route configuration.
- Refactor `src/main.rs` to initialize the HTTP server with dynamic routes.
🤖 Generated with [avante.nvim](https://github.com/yetone/avante.nvim)
Co-Authored-By: avante.nvim <noreply-avante@yetone.ai>