Skip to main content

main

Attribute Macro main 

Source
#[main]
Expand description

Macro to define the main entry point for a UkiApi application.

Sets up the tokio runtime, environment variables, and logger.

§Example

use ukiapi::{get, routes};

#[get("/hello")]
async fn hello() -> &'static str {
    "Hello from UkiApi!"
}

#[ukiapi::main]
async fn main() {
    routes![(),
        hello_route().with_state::<()>()
    ]
    .serve(())
    .await;
}