Feat: Add web interface for case listing and audio playback
Introduces a new web interface to list cases and play back audio recordings. This includes: - A new `web` module in `routes` to handle web requests. - `handle_case_list` to scan and display available cases and their recordings. - `handle_audio` to serve audio files, with validation to prevent path traversal and ensure correct file types. - `AppError::NotFound` variant to handle missing resources gracefully. - Updates to `projektplan.md` to document the change in STT container and m4a preprocessing. - New tests in `server/tests/web_test.rs` to ensure the web interface functions correctly.
This commit is contained in:
@@ -5,6 +5,7 @@ use serde_json::json;
|
||||
pub enum AppError {
|
||||
Unauthorized,
|
||||
BadRequest(String),
|
||||
NotFound(String),
|
||||
Internal(String),
|
||||
}
|
||||
|
||||
@@ -13,6 +14,7 @@ impl IntoResponse for AppError {
|
||||
let (status, message) = match &self {
|
||||
Self::Unauthorized => (StatusCode::UNAUTHORIZED, "Unauthorized".to_owned()),
|
||||
Self::BadRequest(msg) => (StatusCode::BAD_REQUEST, msg.clone()),
|
||||
Self::NotFound(msg) => (StatusCode::NOT_FOUND, msg.clone()),
|
||||
Self::Internal(msg) => (StatusCode::INTERNAL_SERVER_ERROR, msg.clone()),
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user