cargo add Arhimondus/actix-fbr
use actix_web::{Responder, HttpServer, App, web, HttpResponse};
use actix_fbr::{routes, services};
routes!("src/routes");
#[actix_web::main]
async fn main() -> std::io::Result<()> {
HttpServer::new(|| {
App::new()
.route("/", web::to(|| async { HttpResponse::Ok().body("index") }))
.service(services!("src/routes"))
})
.bind(("127.0.0.1", 8080))?
.run()
.await
}
use actix_web::{Responder};
pub async fn get() -> impl Responder {
"[get] one1"
}
use actix_web::{Responder};
pub async fn get() -> impl Responder {
"[get] one2"
}
Only first level paths support.