Crate fregate

source ·
Expand description

Set of instruments to simplify http server set-up.

This project is in progress and might change a lot from version to version.

Example:

use fregate::{
    axum::{routing::get, Router},
    bootstrap, tokio, AppConfig, Application,
};

async fn handler() -> &'static str {
    "Hello, World!"
}

#[tokio::main]
async fn main() {
    let config: AppConfig = bootstrap([]).unwrap();

Application::new(config)
        .router(Router::new().route("/", get(handler)))
        .serve()
        .await
        .unwrap();
}

Examples

Examples can be found here.

Re-exports

Modules

Macros

Structs

Enums

Functions

  • Reads AppConfig and calls init_tracing. Return Error if fails to read AppConfig or init_tracing returns error. Return Error if called twice because of internal call to [tracing_subscriber::registry().try_init()].