use next_web_dev::{ application::Applictaion, router::{open_router::OpenRouter, private_router::PrivateRouter},};
use next_web_core::{
async_trait, context::properties::ApplicationProperties, ApplicationContext
};
use axum::routing::post;
#[derive(Default, Clone)]
pub struct TestApplication;
#[async_trait]
impl Application for TestApplication {
async fn init_middleware(&mut self, properties: &ApplicationProperties) {}
async fn application_router(&mut self, ctx: &mut ApplicationContext) -> (OpenRouter, PrivateRouter) {
(OpenRouter::default(), PrivateRouter(axum::Router::new().route("/test", post(test_fn))))
}
}
#[tokio::main]
async fn main() {
TestApplication::run().await;
}