Default the web server to returning index.html

This commit is contained in:
Valentin Tolmer 2021-05-14 10:23:12 +02:00
parent da4009b0b7
commit f19a4b36de

View File

@ -192,7 +192,9 @@ where
.configure(api_config::<Backend>),
)
// Serve the /pkg path with the compiled WASM app.
.service(Files::new("/pkg", "./app/pkg"));
.service(Files::new("/pkg", "./app/pkg"))
// Default to serve index.html for unknown routes, to support routing.
.service(web::scope("/").route("/.*", web::get().to(index)));
}
struct AppState<Backend>