Crate wasmcloud_actor_http_server[][src]

HTTP Server wasmCloud 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.

Example:

extern crate wasmcloud_actor_http_server as http;
use wapc_guest::HandlerResult;
use http::{Request, Response, Handlers};

#[no_mangle]
pub fn wapc_init() {
    http::Handlers::register_handle_request(hello);
}

fn hello(_msg: http::Request) -> HandlerResult<http::Response> {
    Ok(http::Response::ok())
}

Re-exports

pub use generated::deserialize;
pub use generated::serialize;
pub use generated::Request;
pub use generated::Response;

Modules

generated