AppFlowy-Cloud/admin_frontend/src/api.rs

17 lines
328 B
Rust

use axum::{routing::post, Router};
use leptos::{server, ServerFnError};
pub fn api_router() -> Router {
Router::new().route("/test", post(test_handler))
}
pub async fn test_handler() -> String {
"Test from api".to_string()
}
#[server(Foo)]
pub async fn foo() -> Result<(), ServerFnError> {
println!("Foo!");
Ok(())
}