Uh oh!
There was an error while loading. Please reload this page.
Implement an HTTP server framework. - #52
Conversation
Add a wstd API for creating HTTP server applications, wrapping the WASI proxy world trait and macro. Compiling the example with `RUSTFLAGS="-Clink-arg=--wasi-adapter=proxy"` produces a program that runs in `wasmtime serve`.
This comment was marked as resolved.
This comment was marked as resolved.
pchickey
left a comment
There was a problem hiding this comment.
This is a lot of really great work! Various quibbles.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
| .map_err(|_| WasiHttpErrorCode::HttpRequestMethodInvalid)?; | ||
| let scheme = match incoming.scheme() { | ||
| Some(scheme) => Some( | ||
| from_wasi_scheme(scheme).expect("TODO: what shall we do with an invalid uri here?"), |
There was a problem hiding this comment.
I think there's a good answer to all of these expect/todos when using wstd::error::Error so can we clean all those up before landing?
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
To support this, add `Duration::as_millis` and related functions.
Uh oh!
There was an error while loading. Please reload this page.
The client can bubble this into a `wstd::http::Error`. The server currently just does `.expect`, but at least now, if we want it to do something different, it's more clear what the options are.
pchickey
left a comment
There was a problem hiding this comment.
This looks good to go, if needed we can golf on some of the error TODOs later without changing any interfaces, so we can land this whenever you are ready.
Add a wstd API for creating HTTP server applications, wrapping the WASI proxy world trait and macro.
This is split out from #34 to separate it from the client API changes for easier reviewing.