3个版本
0.1.2 | 2021年4月16日 |
---|---|
0.1.1 | 2021年2月17日 |
0.1.0 | 2021年2月10日 |
在WebAssembly中排名第1613
每月下载量54次
用于 8 crates
12KB
179 代码行
wasmCloud HTTP服务器Actor接口
此crate为wasmCloud actors提供了一个与HTTP服务器能力提供者的接口。使用此接口的actors必须具有wasmcloud:httpserver
声明,以便获得处理请求的权限,并且它们必须有一个活动且配置好的绑定到HTTP服务器能力提供者。
HTTP服务器提供者是单向的,只向actors传递消息。actors不能向此提供者发起主机调用。
以下是如何使用此提供者的示例
extern crate wasmcloud_actor_http_server as http;
extern crate wasmcloud_actor_core as actor;
#[macro_use]
extern crate serde_json;
#[actor::init]
pub fn init() {
http::Handlers::register_handle_request(increment_counter);
}
fn increment_counter(msg: http::Request) -> HandlerResult<http::Response> {
Ok(http::Response::ok())
}
依赖项
~1-2MB
~42K SLoC