refactor: moving example away from admin, preparing more repository examples
This commit is contained in:
parent
0e6649de1b
commit
e8ddfb25fa
@ -3,7 +3,6 @@ use axum::{routing::get, routing::post, Router};
|
|||||||
use crate::state::AppState;
|
use crate::state::AppState;
|
||||||
|
|
||||||
pub mod domain;
|
pub mod domain;
|
||||||
pub mod example;
|
|
||||||
pub mod state;
|
pub mod state;
|
||||||
pub mod views;
|
pub mod views;
|
||||||
|
|
||||||
|
1
src/admin_examples/mod.rs
Normal file
1
src/admin_examples/mod.rs
Normal file
@ -0,0 +1 @@
|
|||||||
|
pub mod static_repository;
|
@ -1,7 +1,7 @@
|
|||||||
// implementation of static repository
|
// implementation of static repository
|
||||||
|
|
||||||
use super::domain::*;
|
use crate::admin::domain::*;
|
||||||
use super::state::AdminRegistry;
|
use crate::admin::state::AdminRegistry;
|
||||||
use log::{debug, warn};
|
use log::{debug, warn};
|
||||||
use serde_json::{json, Value};
|
use serde_json::{json, Value};
|
||||||
|
|
@ -1,11 +1,12 @@
|
|||||||
mod admin;
|
mod admin;
|
||||||
|
mod admin_examples;
|
||||||
mod howto;
|
mod howto;
|
||||||
mod service;
|
mod service;
|
||||||
mod state;
|
mod state;
|
||||||
|
|
||||||
use crate::admin::example;
|
|
||||||
use crate::service::{handlers, templates};
|
use crate::service::{handlers, templates};
|
||||||
use crate::state::AppState;
|
use crate::state::AppState;
|
||||||
|
use admin_examples::static_repository;
|
||||||
use axum::{
|
use axum::{
|
||||||
extract::State, handler::HandlerWithoutStateExt, response::IntoResponse, routing::get, Router,
|
extract::State, handler::HandlerWithoutStateExt, response::IntoResponse, routing::get, Router,
|
||||||
};
|
};
|
||||||
@ -34,7 +35,7 @@ async fn main() {
|
|||||||
// Prepare App State
|
// Prepare App State
|
||||||
let tmpl = templates::Templates::initialize().expect("Template Engine could not be loaded.");
|
let tmpl = templates::Templates::initialize().expect("Template Engine could not be loaded.");
|
||||||
let mut admin = admin::state::AdminRegistry::new("admin");
|
let mut admin = admin::state::AdminRegistry::new("admin");
|
||||||
example::register_example(&mut admin);
|
static_repository::register_example(&mut admin);
|
||||||
|
|
||||||
let state: AppState = AppState {
|
let state: AppState = AppState {
|
||||||
templates: tmpl,
|
templates: tmpl,
|
||||||
|
Loading…
Reference in New Issue
Block a user