1 unstable release

0.6.0 Jan 17, 2022

#1246 in HTTP server

MIT license

180KB
3.5K SLoC

Stable Test codecov Rust Docs Crate version Download License: MIT

This crate provides async-std-based runtime and acceptor for roa.

use roa::http::StatusCode;
use roa::{App, Context};
use roa_async_std::{Listener, Exec};
use std::error::Error;

async fn end(_ctx: &mut Context) -> roa::Result {
    Ok(())
}

#[async_std::main]
async fn main() -> Result<(), Box<dyn Error>> {
    let (addr, server) = App::with_exec((), Exec).end(end).run()?;
    println!("server is listening on {}", addr);
    server.await?;
    Ok(())
}

Dependencies

~13–27MB
~396K SLoC