add WASI-HTTP interface documentation and usage example#56
Conversation
There was a problem hiding this comment.
Pull request overview
Adds module-level documentation describing an alternative WASI-HTTP (wstd) interface path alongside the existing FastEdge SDK usage, including a minimal async fetch example and build instructions using cargo-component.
Changes:
- Documented a WASI-HTTP (
wstd) async handler alternative to the FastEdge SDK. - Added a minimal
wstdclient example pluscargo-componentbuild steps. - Added related reference links (WASI-HTTP,
wstd,cargo-component, fetch example).
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 1 out of 1 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 4 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
dd5135d to
8b5444b
Compare
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 6 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| //! ```no_run | ||
| //! use wstd::http::body::Body; | ||
| //! use wstd::http::{Client, Request, Response}; | ||
| //! | ||
| //! #[wstd::http_server] | ||
| //! async fn main(_request: Request<Body>) -> anyhow::Result<Response<Body>> { | ||
| //! let upstream_req = Request::get("https://api.example.com/data") | ||
| //! .header("accept", "application/json") | ||
| //! .body(Body::empty())?; | ||
| //! | ||
| //! let response = Client::new().send(upstream_req).await?; | ||
| //! Ok(response) | ||
| //! } |
There was a problem hiding this comment.
This new rustdoc example is marked no_run, so it still must compile during doctests, but the fastedge crate does not declare wstd (or anyhow) as a (dev-)dependency. As written, cargo test will fail when running doc tests. Consider switching the block to ignore (or adding the needed crates under [dev-dependencies], possibly behind a feature) so docs don’t introduce uncompilable examples.
No description provided.