my trunk.toml below
[[proxy]]
rewrite = "/api/"
backend = "http://localhost:8080/"
my server setting:
.service(
web::scope("/blog")
.route("/{id}", web::get().to(get_blog))
)
.bind(("localhost", 8080))?
.workers(2)
.run()
.await
my request in yew:
wasm_bindgen_futures::spawn_local(async move {
let blog: BlogPost = Request::get(format!("/api/blog/{}", id).as_str()).mode(gloo_net::http::RequestMode::NoCors).send().await.unwrap().json().await.unwrap();
})
the trunk print:
2023-10-20T13:33:54.492068Z INFO success
2023-10-20T13:33:56.839970Z ERROR response failed classification=Status code: 502 Bad Gateway latency=2015 ms
i'm sure that my server is ok. and there is a weird thing: 'trunk serve --proxy-backend=https://yew.rs/tutorial/ --proxy-rewrite=/tutorial/' this is ok.....😭