This is a library for making your flow function acting as a lambda service in [test.flows.network](https://test.flows.network).
## Example usage
```rust
use lambda_flows::{listen_to_request, message_from_request, send_response};
#[no_mangle]
pub fn register() {
listen_to_request();
}
#[no_mangle]
pub fn work() {
let (qry, body) = message_from_request();
send_response(
200,
vec![(String::from("content-type"), String::from("text/html"))],
"ok".as_bytes().to_vec(),
);
}
```
In `register()` the [`listen_to_request`](https://docs.rs/lambda-flows/latest/lambda_flows/fn.listen_to_request.html) 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`](https://docs.rs/lambda-flows/latest/lambda_flows/fn.message_from_request.html) then set the status, headers and body of the response using [`send_response`](https://docs.rs/lambda-flows/latest/lambda_flows/fn.send_response.html).
The whole document is [here](https://docs.rs/lambda-flows).