https://github.com/hexilee/roa
async web framework inspired by koajs, lightweight but powerful.
https://github.com/hexilee/roa
koa koa-like rust-lang rust-web web
Last synced: 23 days ago
JSON representation
async web framework inspired by koajs, lightweight but powerful.
- Host: GitHub
- URL: https://github.com/hexilee/roa
- Owner: Hexilee
- License: mit
- Created: 2020-01-19T05:27:08.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-29T05:49:15.000Z (over 2 years ago)
- Last Synced: 2025-04-04T11:11:12.650Z (23 days ago)
- Topics: koa, koa-like, rust-lang, rust-web, web
- Language: Rust
- Homepage:
- Size: 1.06 MB
- Stars: 249
- Watchers: 7
- Forks: 11
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
Roa
Roa is an async web framework inspired by koajs, lightweight but powerful.
[](https://github.com/Hexilee/roa/actions)
[](https://codecov.io/gh/Hexilee/roa)
[](https://github.com/Hexilee/roa/wiki)
[](https://docs.rs/roa)
[](https://crates.io/crates/roa)
[](https://crates.io/crates/roa)
[](https://blog.rust-lang.org/2021/07/29/Rust-1.54.0.html)
[](https://github.com/Hexilee/roa/blob/master/LICENSE)
Examples
|
Guide
|
Cookbook
#### Feature highlights
- A lightweight, solid and well extensible core.
- Supports HTTP/1.x and HTTP/2.0 protocols.
- Full streaming.
- Highly extensible middleware system.
- Based on [`hyper`](https://github.com/hyperium/hyper), runtime-independent, you can chose async runtime as you like.
- Many useful extensions.
- Official runtime schemes:
- (Default) [tokio](https://github.com/tokio-rs/tokio) runtime and TcpStream.
- [async-std](https://github.com/async-rs/async-std) runtime and TcpStream.
- Transparent content compression (br, gzip, deflate, zstd).
- Configurable and nestable router.
- Named uri parameters(query and router parameter).
- Cookie and jwt support.
- HTTPS support.
- WebSocket support.
- Asynchronous multipart form support.
- Other middlewares(logger, CORS .etc).
- Integrations
- roa-diesel, integration with [diesel](https://github.com/diesel-rs/diesel).
- roa-juniper, integration with [juniper](https://github.com/graphql-rust/juniper).
- Works on stable Rust.#### Get start
```toml
# Cargo.toml[dependencies]
roa = "0.6"
tokio = { version = "1.15", features = ["rt", "macro"] }
``````rust,no_run
use roa::App;
use roa::preload::*;#[tokio::main]
async fn main() -> anyhow::Result<()> {
let app = App::new().end("Hello, World");
app.listen("127.0.0.1:8000", |addr| {
println!("Server is listening on {}", addr)
})?
.await?;
Ok(())
}
```
Refer to [wiki](https://github.com/Hexilee/roa/wiki) for more details.