next-web-dev

Crates.ionext-web-dev
lib.rsnext-web-dev
version
sourcesrc
created_at2025-04-26 08:09:02.901049+00
updated_at2025-05-04 14:20:11.757668+00
descriptionNext Web Dev!
homepage
repository
max_upload_size
id1650033
Cargo.toml error:TOML parse error at line 17, column 1 | 17 | autolib = false | ^^^^^^^ unknown field `autolib`, expected one of `name`, `version`, `edition`, `authors`, `description`, `readme`, `license`, `repository`, `homepage`, `documentation`, `build`, `resolver`, `links`, `default-run`, `default_dash_run`, `rust-version`, `rust_dash_version`, `rust_version`, `license-file`, `license_dash_file`, `license_file`, `licenseFile`, `license_capital_file`, `forced-target`, `forced_dash_target`, `autobins`, `autotests`, `autoexamples`, `autobenches`, `publish`, `metadata`, `keywords`, `categories`, `exclude`, `include`
size0
Listening (yuenxillar)

documentation

README

Next Web Dev

Dev - make everything simpler

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::get;
// use async_trait::async_trait

/// Test application
#[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", get(test_fn))))
    }
}


async fn test_fn() -> &'static str {
    " Hello Axum! \n Hello Next Web!"
}

#[tokio::main]
async fn main() {
    TestApplication::run().await;
}

Commit count: 0

cargo fmt