This is a library for making your flow function acting as a lambda service in test.flows.network.
```rust use lambdaflows::{listentorequest, messagefromrequest, sendresponse};
pub fn register() { listentorequest(); }
pub fn work() { let (qry, body) = messagefromrequest(); sendresponse( 200, vec![(String::from("content-type"), String::from("text/html"))], "ok".asbytes().to_vec(), ); } ```
In register()
the listen_to_request
will create a listener for the http request.
When a request is received, the work()
will be called. We get the query and body using message_from_request
then set the status, headers and body of the response using send_response
.
The whole document is here.