Fix static file location

This commit is contained in:
Chris Jean-Marie 2022-03-12 03:42:04 +00:00
parent b48090656b
commit ab0579b45b
1 changed files with 8 additions and 6 deletions

View File

@ -57,12 +57,14 @@ async fn main() {
// `GET /` goes to `root` // `GET /` goes to `root`
.nest( .nest(
"/assets", "/assets",
get_service(ServeDir::new(".")).handle_error(|error: std::io::Error| async move { get_service(ServeDir::new("templates/assets")).handle_error(
( |error: std::io::Error| async move {
StatusCode::INTERNAL_SERVER_ERROR, (
format!("Unhandled internal error: {}", error), StatusCode::INTERNAL_SERVER_ERROR,
) format!("Unhandled internal error: {}", error),
}), )
},
),
) )
.route("/", get(index)) .route("/", get(index))
.layer(Extension(store)) .layer(Extension(store))