ruwebframe 0.1.3

a simple webframe for rust actix-web, based on rudi and rbatis.
Documentation
use actix_web::{get, post, web, App, HttpResponse, HttpServer, Responder};

#[get("/")]
async fn hello() -> impl Responder {
    HttpResponse::Ok().body("Hello, Actix Web!")
}

#[post("/echo")]
async fn echo(req_body: String) -> impl Responder {
    HttpResponse::Ok().body(req_body)
}

async fn manual_hello() -> impl Responder {
    HttpResponse::Ok().body("Hey there!")
}

#[actix_web::main]
async fn main() -> std::io::Result<()> {
    HttpServer::new(|| {
        App::new()
            .service(hello)           // 宏定义路由
            .service(echo)
            .route("/hey", web::get().to(manual_hello))  // 手动路由
    })
        .bind(("127.0.0.1", 8080))?
        .run()
        .await
}