humbird network communication core library
You Know, for Faster!
humbird = "0.1.2"
```rust use humbird::{ config::config::loadconfig, protocol::http::{Request, Response}, registerrouter_plugin, run, };
fn test1(req: Request, mut res: Response) -> Response { res.body = "response.....".asbytes().to_vec(); res }
fn test2(req: Request, mut res: Response) -> Response { res.body = "response.....".asbytes().to_vec(); res }
fn main() { // load config loadconfig( "/Users/max/GitProject/Humbird/humbird-server/src/config-template.toml".tostring(), ); // register routing plug-in // path binding registerrouterplugin!( "/".tostring() => test1, "/test".tostring() => test2 ); // run humbird server run!(); } ```
Server configuration file templat ``` [server]
port = "port"
[directory]
root-path = ""
[proxy]
target = ["0.0.0.0:80", ""0.0.0.0:8080", "0.0.0.0:8888"]
mode = "WEIGHT" ```