I'm trying to return multiple documents (index.html
, style.css
) in an HTTP response when a user makes a single HTTP request. How do I go about doing this? I'm thinking using something like a std::io::File
instance to return these, but this hasn't worked out so far.
The function and route below are the ones the user interacts with when visiting the website for the first time.
I have read Rocket's documentation about NamedFile
and StaticFiles
but I'm not so sure that these are the correct solutions in this scenario.
#[get("/")]
fn index() -> Response<'static> {
let mut response = Response::new();
response.set_status(Status::Ok);
response
}