Serving files is working
Right now we're not doing any streaming and this isn't ideal. I'll need to figure it out at some point.
This commit is contained in:
@@ -9,7 +9,7 @@ pub fn list_files(dir: PathBuf) -> io::Result<Vec<PathBuf>> {
|
||||
.filter(|entry| is_image_or_video(&entry.path()) || entry.file_type().unwrap().is_dir())
|
||||
.map(|entry| entry.path())
|
||||
.map(|path: PathBuf| {
|
||||
let relative = path.strip_prefix(std::env::current_dir().unwrap()).unwrap();
|
||||
let relative = path.strip_prefix(dotenv::var("BASE_PATH").unwrap()).unwrap();
|
||||
relative.to_path_buf()
|
||||
})
|
||||
.collect::<Vec<PathBuf>>();
|
||||
|
||||
Reference in New Issue
Block a user