#webassembly #wasm #wasmcloud #actor

dev wasmcloud-actor-http-server

HTTP Server Actor Interface for wasmCloud Actors

3 releases

0.1.2 Apr 16, 2021
0.1.1 Feb 17, 2021
0.1.0 Feb 10, 2021

#434 in WebAssembly

Download history 28/week @ 2021-02-20 54/week @ 2021-02-27 13/week @ 2021-03-06 63/week @ 2021-03-13 72/week @ 2021-03-20 45/week @ 2021-03-27 41/week @ 2021-04-03 143/week @ 2021-04-10 67/week @ 2021-04-17 59/week @ 2021-04-24 31/week @ 2021-05-01 25/week @ 2021-05-08 47/week @ 2021-05-15 31/week @ 2021-05-22 33/week @ 2021-05-29 17/week @ 2021-06-05

241 downloads per month
Used in less than 8 crates

Apache-2.0

11KB
179 lines

crates.io  Rust license  documentation

wasmCloud HTTP Server Actor Interface

This crate provides wasmCloud actors with an interface to the HTTP Server capability provider. Actors using this interface must have the claim wasmcloud:httpserver in order to have permission to handle requests, and they must have an active, configured binding to an HTTP Server capability provider.

The HTTP Server provider is one-way, and only delivers messages to actors. Actors cannot make host calls to this provider.

The following is an example of how to use this provider:

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())
}

Dependencies

~1.3–2.1MB
~47K SLoC