add static files
we have a favicon now :') Signed-off-by: Gunwant Jain <mail@wantguns.dev>
This commit is contained in:
parent
1175a57539
commit
c6262e9e87
10 changed files with 12 additions and 2 deletions
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()
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue