kegani 0.1.1

A developer-friendly, ergonomic, production-ready Rust web framework
Documentation
//! Kegani binary entry point
//!
//! Example application demonstrating Kegani framework features.

use actix_web::{web, HttpResponse};
use kegani::prelude::*;

/// Simple hello endpoint
async fn hello() -> HttpResponse {
    HttpResponse::Ok().body("Hello from Kegani!")
}

#[tokio::main]
async fn main() -> std::io::Result<()> {
    // Initialize logging
    tracing_subscriber::fmt()
        .with_env_filter(
            tracing_subscriber::EnvFilter::try_from_default_env()
                .unwrap_or_else(|_| tracing_subscriber::EnvFilter::new("info")),
        )
        .init();

    tracing::info!("Starting Kegani server...");
    tracing::info!("API Docs: http://127.0.0.1:8080/api-docs/swagger-ui");
    tracing::info!("ReDoc: http://127.0.0.1:8080/api-docs/redoc");

    App::new()
        .port(8080)
        .configure(|cfg| {
            cfg.service(
                web::scope("/api")
                    .route("/hello", web::get().to(hello)),
            );
        })
        .run()
        .await
}