feat: finish rust web dual pane document shell
This commit is contained in:
@@ -1,5 +1,6 @@
|
||||
use crate::middleware::request_context::inject_request_context;
|
||||
use crate::routes::build_router;
|
||||
use crate::local_folder_watcher_registry::LocalFolderWatcherRegistry;
|
||||
use axum::Router;
|
||||
use std::env;
|
||||
use std::fs;
|
||||
@@ -132,18 +133,24 @@ fn read_env_or_dotenv(key: &str) -> Option<String> {
|
||||
#[derive(Debug, Clone)]
|
||||
pub struct AppState {
|
||||
config: Arc<AppConfig>,
|
||||
local_folder_watcher_registry: LocalFolderWatcherRegistry,
|
||||
}
|
||||
|
||||
impl AppState {
|
||||
pub fn new(config: AppConfig) -> Self {
|
||||
Self {
|
||||
config: Arc::new(config),
|
||||
local_folder_watcher_registry: LocalFolderWatcherRegistry::new(),
|
||||
}
|
||||
}
|
||||
|
||||
pub fn config(&self) -> &AppConfig {
|
||||
self.config.as_ref()
|
||||
}
|
||||
|
||||
pub fn local_folder_watcher_registry(&self) -> &LocalFolderWatcherRegistry {
|
||||
&self.local_folder_watcher_registry
|
||||
}
|
||||
}
|
||||
|
||||
pub fn build_app(state: AppState) -> Router {
|
||||
|
||||
Reference in New Issue
Block a user