Skip to content

Commit f25c831

Browse files
Update README.md (#427)
Clarify that fetch_with_str() requires a Url and a Path alone is not enough.
1 parent be941bb commit f25c831

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

README.md

+2-1
Original file line numberDiff line numberDiff line change
@@ -158,7 +158,8 @@ pub async fn main(req: Request, env: Env, _ctx: worker::Context) -> Result<Respo
158158
.on_async("/durable", |_req, ctx| async move {
159159
let namespace = ctx.durable_object("CHATROOM")?;
160160
let stub = namespace.id_from_name("A")?.get_stub()?;
161-
stub.fetch_with_str("/messages").await
161+
// `fetch_with_str` requires a valid Url to make request to DO. But we can make one up!
162+
stub.fetch_with_str("http://fake_url.com/messages").await
162163
})
163164
.get("/secret", |_req, ctx| {
164165
Response::ok(ctx.secret("CF_API_TOKEN")?.to_string())

0 commit comments

Comments
 (0)