main

Attribute Macro main 

Source
#[main]
Expand description

Attribute macro for async main functions in elif.rs applications

This macro simplifies the bootstrap process by handling tokio runtime setup, logging initialization, and proper error conversion between bootstrap and HTTP errors.

§Examples

§Basic Bootstrap Usage

use elif::prelude::*;
 
#[elif::main]
async fn main() -> Result<(), HttpError> {
    AppModule::bootstrap().listen("127.0.0.1:3000").await
}

§With Manual Server Setup

use elif::prelude::*;
 
#[elif::main]
async fn main() -> Result<(), HttpError> {
    let server = Server::new();
    server.listen("127.0.0.1:3000").await
}