Default the web server to returning index.html

This commit is contained in:
Valentin Tolmer committed 2021-05-14 10:30:58 +02:00
1 parent da4009b0b7
commit f19a4b36de
1 file changed
+3 -1
+3 -1
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>