diff --git a/public/index.html b/examples/public/index.html similarity index 100% rename from public/index.html rename to examples/public/index.html diff --git a/public/lorem_ipsum.txt b/examples/public/lorem_ipsum.txt similarity index 100% rename from public/lorem_ipsum.txt rename to examples/public/lorem_ipsum.txt diff --git a/examples/src/serving_files.gleam b/examples/src/serving_files.gleam index 8e5eb5c..6b36841 100644 --- a/examples/src/serving_files.gleam +++ b/examples/src/serving_files.gleam @@ -26,7 +26,7 @@ fn serve_file(path: String) -> Response { // In production, make sure to validate paths to prevent directory traversal // attacks! (e.g., requests to "../../../etc/passwd") // - case ewe.file("public" <> path, offset: None, limit: None) { + case ewe.file("public/" <> path, offset: None, limit: None) { Ok(file) -> { // Using "application/octet-stream" is safe for any file type, but you // may want to specify content-type based on file extension in production.