use rocket::response::NamedFile; use std::io; use std::path::{Path, PathBuf}; #[get("/")] pub fn index() -> io::Result { NamedFile::open("static/index.html") } #[get("/", rank = 2)] pub fn files(file: PathBuf) -> io::Result { NamedFile::open(Path::new("static/").join(file)) }