1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
//!
//! A micro Web framework based on Hyper, Futures and Tokio.
//!
//! # Example
//! ```{rust,ignore}
//! extern crate susanoo;
//!
//! use susanoo::prelude::*;
//!
//! fn hello(ctx: Context) -> Outcome<Response> {
//!     ctx.respond(
//!         RawResponse::new()
//!             .with_body("Hello, world"),
//!     )
//! }
//!
//! fn main() {
//!     let s = Susanoo::default()
//!         .with_route(Route::get("/", hello));
//!     s.run().unwrap()
//! }
//! ```

pub extern crate futures;
pub extern crate hyper;
pub extern crate tokio_core;
pub extern crate typemap;
#[macro_use]
extern crate error_chain;
extern crate regex;

mod context;
mod errors;
mod handler;
mod outcome;
mod request;
pub mod response;
mod router;
mod susanoo;

// re-exports

pub use hyper::header;
pub use hyper::StatusCode;
pub use hyper::Response as RawResponse;

pub use context::Context;
pub use errors::HandleError;
pub use handler::{Handler, Middleware};
pub use outcome::Outcome;
pub use request::Request;
pub use response::{Response, Responder, Html, Redirect};
pub use router::Route;
pub use susanoo::Susanoo;

pub mod prelude {
    pub use context::Context;
    pub use handler::{Handler, Middleware};
    pub use outcome::Outcome;
    pub use response::Response;
    pub use router::Route;
    pub use susanoo::Susanoo;
    pub use errors::HandleError;
}