Skip to content

Commit

Permalink
Update README.md (#427)
Browse files Browse the repository at this point in the history
Clarify that fetch_with_str() requires a Url and a Path alone is not enough.
  • Loading branch information
andrewdavidmackenzie authored Feb 19, 2024
1 parent be941bb commit f25c831
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,8 @@ pub async fn main(req: Request, env: Env, _ctx: worker::Context) -> Result<Respo
.on_async("/durable", |_req, ctx| async move {
let namespace = ctx.durable_object("CHATROOM")?;
let stub = namespace.id_from_name("A")?.get_stub()?;
stub.fetch_with_str("/messages").await
// `fetch_with_str` requires a valid Url to make request to DO. But we can make one up!
stub.fetch_with_str("http://fake_url.com/messages").await
})
.get("/secret", |_req, ctx| {
Response::ok(ctx.secret("CF_API_TOKEN")?.to_string())
Expand Down

0 comments on commit f25c831

Please sign in to comment.