amoeba 0.1.1

A lightweight HTTP API library for Rust
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use amoeba::{HttpError, Request, Response, Route, Server};

struct Ctx();

fn index(_: &mut Ctx, _: Request) -> Result<Response, HttpError> {
    println!("index endpoint called");
    Ok(Response::no_content())
}

fn main() {
    Server::new("localhost:8080", Ctx())
        .route(Route::new("GET", "/", index))
        .run();
}