use crate::app::state::ApplicationState;
use rocket::fs::NamedFile;
use rocket_codegen::get;
use std::path::PathBuf;

#[get("/assets/<file..>")]
pub async fn files(file: PathBuf, state: &rocket::State<ApplicationState>) -> Option<NamedFile> {
    NamedFile::open(state.assets_dir.join(file)).await.ok()
}
