Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

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: about 2 months ago
JSON representation

async web framework inspired by koajs, lightweight but powerful.

Awesome Lists containing this project

README

        


Roa


Roa is an async web framework inspired by koajs, lightweight but powerful.


[![Stable Test](https://github.com/Hexilee/roa/workflows/Stable%20Test/badge.svg)](https://github.com/Hexilee/roa/actions)
[![codecov](https://codecov.io/gh/Hexilee/roa/branch/master/graph/badge.svg)](https://codecov.io/gh/Hexilee/roa)
[![wiki](https://img.shields.io/badge/roa-wiki-purple.svg)](https://github.com/Hexilee/roa/wiki)
[![Rust Docs](https://docs.rs/roa/badge.svg)](https://docs.rs/roa)
[![Crate version](https://img.shields.io/crates/v/roa.svg)](https://crates.io/crates/roa)
[![Download](https://img.shields.io/crates/d/roa.svg)](https://crates.io/crates/roa)
[![MSRV-1.54](https://img.shields.io/badge/MSRV-1.54-blue.svg)](https://blog.rust-lang.org/2021/07/29/Rust-1.54.0.html)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](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.