[][src]Crate limiting_factor

A library with components to implement a REST API.

The goal of this crate is to provide:

That allows an API or a back-end web server to focus on requests and data model.

Examples

A simple server serving a 200 ALIVE response on /status :

use limiting_factor::kernel::DefaultApplication;

pub fn run () {
    let routes = routes![
        status,
    ];

    DefaultApplication::start_application(routes);
}

#[get("/status")]
pub fn status() -> &'static str {
    "ALIVE"
}

Replacing DefaultApplication by MinimalApplication allows to use a lighter version of the library without Diesel dependencies or database use.

Modules

api

Utilities for API.

config

Service configuration.

database

This module handles a database layer, mainly intended to be used with a web server or framework like Rocket or Iron.

kernel

Service execution utilities.

Type Definitions

ErrorResult