aitch 0.1.1

A HTTP server toolkit, loosely based on Go's net/http.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
extern crate aitch;
extern crate http;

use aitch::handlers::static_files::static_files_handler;
use aitch::servers::hyper::Server;
use aitch::{middlewares, Result};

fn main() -> Result<()> {
    // NOTE: this expects to be run from the root of the repository.
    // The folder contains an index.html: browse to http://localhost:3000/index.html
    let handler = static_files_handler("./examples/static-files/")?;
    let wrapped = middlewares::with_stdout_logging(handler);

    let addr = "127.0.0.1:3000".parse()?;
    println!("Listening on http://{}", addr);
    Server::new(addr, wrapped)?.run()
}