Arc-reactor

Arc Reactor

An asynchronous, multi-threaded and minimal web framework for Rust.

Crates.io

Features

Installation

Add this to your cargo.toml

toml arc-reactor = "0.1"

Demo

```rust

![feature(conservativeimpltrait, procmacro, generators, boxsyntax)] // <== need to add this.

extern crate arc_reactor;

[macro_use]

extern crate serdejson; use arcreactor::prelude::*; use arc_reactor::{Router, ArcReactor, StatusCode};

fn main() { ArcReactor::new() .routes(rootRoutes()) .port(3000) .initiate() .unwrap() }

fn rootRoutes() -> Router { Router::new() .get("/", IndexRoute) }

[service]

fn IndexRoute(_req: Rrequest, res: Response) { let isAuth = await!(fakeFuture()); if isAuth { let payload = json!({ "data": "hello world" });

return Ok(payload.into()) // convert json to json response.

}

res.with_status(StatusCode::UnAuthorized) }

fn fakeFuture() -> impl Future

```

Examples

Check out the examples folder and the api documentation to get a feel for how arc reactor works.
It's well documented and should get you up and running in no time.

Contributions

If you feel something is missing, feel free to submit a PR.

License

Refer to License.