Add proxy routes in startup_default(…)

This commit is contained in:
Ben Schulz committed 2023-03-30 18:01:18 +02:00
1 parent 917acf47fc
commit 2c787f85f4
1 file changed
+3 -1
+3 -1
View File
@@ -447,7 +447,9 @@ pub async fn startup_default(ip: String, port: u16, config: CrateConfig) -> Resu
.service(ServeDir::new(config.crate_dir.join(&dist_path)));
let mut router = Router::new().route("/_dioxus/ws", get(ws_handler));
for proxy_config in config.dioxus_config.web.proxy.unwrap_or_default() {
router = proxy::add_proxy(router, &proxy_config)?;
}
router = router
.fallback(
get_service(file_service).handle_error(|error: std::io::Error| async move {