add static files
we have a favicon now :') Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
7
src/routes/static_files.rs
Normal file
7
src/routes/static_files.rs
Normal file
@@ -0,0 +1,7 @@
|
||||
use std::path::{Path, PathBuf};
|
||||
use rocket::fs::NamedFile;
|
||||
|
||||
#[get("/<file..>", rank = 3)]
|
||||
pub async fn static_files(file: PathBuf) -> Option<NamedFile> {
|
||||
NamedFile::open(Path::new("static/").join(file)).await.ok()
|
||||
}
|
||||
Reference in New Issue
Block a user