Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 6 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 (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2022-09-29T05:49:15.000Z (about 2 years ago)
- Last Synced: 2024-12-13T14:08:13.188Z (13 days ago)
- Topics: koa, koa-like, rust-lang, rust-web, web
- Language: Rust
- Homepage:
- Size: 1.06 MB
- Stars: 249
- Watchers: 8
- Forks: 12
- 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.
[![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.