This commit is contained in:
Face
2025-09-02 20:28:55 +03:00
parent 515b98cae2
commit 16fc5a034f
2 changed files with 22 additions and 7 deletions

View File

@@ -346,7 +346,9 @@ async fn serve_static_file(ctx: &ServerContext) -> Result<GurtResponse> {
.with_string_body("Invalid file path"));
}
let frontend_dir = std::path::Path::new(env!("CARGO_MANIFEST_DIR")).join("frontend");
let current_dir = std::env::current_dir()
.map_err(|_| GurtError::invalid_message("Failed to get current directory"))?;
let frontend_dir = current_dir.join("frontend");
let full_path = frontend_dir.join(file_path);
log::info!("Attempting to read file: '{}'", full_path.display());