|
1 year ago | |
---|---|---|
.. | ||
src | 3 years ago | |
templates | 5 years ago | |
.env | 5 years ago | |
Cargo.toml | 5 years ago | |
README.md | 5 years ago | |
benchmark_config.json | 3 years ago | |
config.toml | 4 years ago | |
roa-core.dockerfile | 1 year ago | |
roa-diesel.dockerfile | 1 year ago | |
roa-pg.dockerfile | 1 year ago | |
roa-sqlx.dockerfile | 1 year ago | |
roa-tokio.dockerfile | 1 year ago | |
roa.dockerfile | 1 year ago | |
rustfmt.toml | 5 years ago |
<a href="https://github.com/Hexilee/roa/tree/master/examples">Examples</a>
<span> | </span>
<a href="https://github.com/Hexilee/roa/wiki/Guide">Guide</a>
<span> | </span>
<a href="https://github.com/Hexilee/roa/wiki/Cookbook">Cookbook</a>
hyper
, runtime-independent, you can chose async runtime as you like.# Cargo.toml
[dependencies]
roa = "0.5.0"
async-std = { version = "1.5", features = ["attributes"] }
use roa::App;
use roa::preload::*;
use std::error::Error as StdError;
#[async_std::main]
async fn main() -> Result<(), Box<dyn StdError>> {
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 for more details.
PostgreSQL.
http://localhost:8080/json
http://localhost:8080/db
http://localhost:8080/queries?q=20
http://localhost:8080/fortune
http://localhost:8080/updates?q=20
http://localhost:8080/plaintext