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