Aero
:rocket: A progressive, idiomatic, and minimalist framework for building Rust HTTP services.
- idiomatic router
- composable middlewares
wip...
- clean code
- response json
- route
- body parser
- file orgnanize
- api orgnanize
- publish
- test
Installation
Add the following line to your Cargo.toml file:
aero = "0.1.3"
Dev
cargo fmt -- */**.rs
cargo run
Usage
-
router
let mut app = new;
let mut router = new;
router.get;
app.mount;
println!;
-
json response
let mut app = new;
let mut router = new;
router.get;
app.mount;
app.get;
println!;
-
middleware
let mut app = new;
app.hold;
app.hold;
app.get;
println!;
examples are listed at examples
Benckmark
Cooper@CooperdeMBP Rust % autocannon http://127.0.0.1:3000/api/shipping/orders
Running 10s test @ http://127.0.0.1:3000/api/shipping/orders
10 connections
┌─────────┬──────┬──────┬───────┬──────┬─────────┬─────────┬──────┐
│ Stat │ 2.5% │ 50% │ 97.5% │ 99% │ Avg │ Stdev │ Max │
├─────────┼──────┼──────┼───────┼──────┼─────────┼─────────┼──────┤
│ Latency │ 0 ms │ 0 ms │ 0 ms │ 0 ms │ 0.01 ms │ 0.04 ms │ 8 ms │
└─────────┴──────┴──────┴───────┴──────┴─────────┴─────────┴──────┘
┌───────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┬─────────┐
│ Stat │ 1% │ 2.5% │ 50% │ 97.5% │ Avg │ Stdev │ Min │
├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
│ Req/Sec │ 46431 │ 46431 │ 52799 │ 53887 │ 52400 │ 2055.79 │ 46410 │
├───────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┼─────────┤
│ Bytes/Sec │ 15.2 MB │ 15.2 MB │ 17.3 MB │ 17.6 MB │ 17.1 MB │ 674 kB │ 15.2 MB │
└───────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┴─────────┘
Req/Bytes counts sampled once per second.
# of samples: 10
524k requests in 10.01s, 171 MB read
License
MIT