add static files

we have a favicon now :')

Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
Gunwant Jain
2021-07-13 03:40:58 +05:30
parent 1175a57539
commit c6262e9e87
10 changed files with 12 additions and 2 deletions

View 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()
}