Modifica la estructura de preparación de una app
This commit is contained in:
parent
af9afca777
commit
fcc022d164
42 changed files with 295 additions and 228 deletions
|
|
@ -1,12 +1,18 @@
|
|||
use pagetop::prelude::*;
|
||||
use pagetop::{prelude::*, core::app::AppTrait};
|
||||
|
||||
fn bootstrap() {
|
||||
include_module(&pagetop_admin::Admin);
|
||||
include_module(&pagetop_user::User);
|
||||
include_module(&pagetop_node::Node);
|
||||
struct Drust;
|
||||
|
||||
impl AppTrait for Drust {
|
||||
fn enabled_modules(&self) -> Vec<&'static dyn ModuleTrait> {
|
||||
vec![
|
||||
&pagetop_admin::Admin,
|
||||
&pagetop_user::User,
|
||||
&pagetop_node::Node,
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
#[actix_web::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
Application::prepare(UsingBootstrap::Fn(bootstrap)).await?.run()?.await
|
||||
Application::prepare(Drust).await?.run()?.await
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue