#actor #http-server #wasmcloud #api-bindings #http-request #http-response

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

#1498 in WebAssembly

Download history 9/week @ 2024-01-08 3/week @ 2024-01-15 2/week @ 2024-01-22 10/week @ 2024-02-05 12/week @ 2024-02-12 23/week @ 2024-02-19 49/week @ 2024-02-26 32/week @ 2024-03-04 24/week @ 2024-03-11 21/week @ 2024-03-18 37/week @ 2024-03-25 71/week @ 2024-04-01 22/week @ 2024-04-08 18/week @ 2024-04-15

149 downloads per month
Used in 8 crates

Apache-2.0

12KB
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.1–2MB
~43K SLoC