responder 0.1.74

Quickly create API:s using this simple and lightweight framework.
Documentation

Responder

Easy to use, easy to set up.

use responder::{ *, request::info::Method };

/*- Initialize -*/
fn main() {

    /*- Initiaize routes -*/
    let routes = Route::Stack("", &[
        Route::Stack("path", &[
            Route::Tail(Method::GET, "enpoint", Function::S(some_function)),
            Route::Tail(Method::GET, "enpoint2", Function::S(some_other_function)),
        ]),
    ]);

    /*- Initiaize server -*/
    Server::new()
        .address("127.0.0.1")            // This will be localhost, use 0.0.0.0 if using docker
        .port(8080)
        .serve("./static")              // Serve static files from a folder
        .not_found("./static/404.html") // Where to direct users going to a path which doesn't exist
        .threads(8)                     // How many threads to handle all requests
        .routes(routes)
        .start()
        .unwrap();

    // Go to 'localhost:8080/path/enpoint' to see results
}