mirror of
https://git.ngram.ca/OpenJam/rc-servers
synced 2026-08-23 23:08:52 +00:00
8 lines
450 B
Rust
8 lines
450 B
Rust
use actix_web::{dev::ResourcePath, get, web::{Data, Path}, Responder};
|
|||
|
|
|
||
|
|
#[get("/customavatar/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("customavatars").join(format!("{}.jpg", name.path()));
|
||
|
|
log::debug!("RC asset at {} (exists? {})", path.display(), path.exists());
|
||
|
|
actix_files::NamedFile::open_async(path).await
|
||
|
|
}
|