Create basic CDN endpoints for #10

This commit is contained in:
NG (Graham) committed 2025-05-24 16:21:45 -04:00
1 parent e7de53929d
commit 59612e6aa3
12 files changed
+53 -7

No files matched your search

+8
View File
@@ -0,0 +1,8 @@
use actix_web::{dev::ResourcePath, get, web::{Data, Path}, Responder};
#[get("/brawldata/Live/{name}")]
pub async fn get(cli: Data<crate::cli::CliArgs>, name: Path<String>) -> impl Responder {
let path = std::path::PathBuf::from(&cli.data_robocraft).join("brawldata").join(format!("{}.jpg", name.path()));
log::debug!("RC asset at {} (exists? {})", path.display(), path.exists());
actix_files::NamedFile::open_async(path).await
}