Something running

This commit is contained in:
Bianca Fürstenau 2025-02-22 07:09:34 +01:00
parent e03a16d13e
commit 49a9810fd8
19 changed files with 173 additions and 132 deletions

View file

@ -1,9 +1,33 @@
mod commands;
pub mod commands;
#[cfg(feature = "server")]
mod server;
pub mod server;
pub mod types;
#[cfg(feature = "server")]
#[cfg(all(feature = "tauri", feature="server"))]
#[cfg_attr(mobile, tauri::mobile_entry_point)]
pub fn run() {
server::run();
use tauri::{Manager, State};
use tauri_plugin_fs::FsExt;
use server::app_state::AppState;
use tokio::sync::Mutex;
let state = AppState::new();
tauri::Builder::default()
.plugin(tauri_plugin_fs::init())
.setup(|app| {
app.manage(Mutex::new(state));
let scope = app.fs_scope();
let path = app.path();
scope.allow_directory(path.temp_dir()?, false)?;
Ok(())
})
.invoke_handler(tauri::generate_handler![
server::swap,
server::count,
server::inventory,
server::data_door::pull_data,
server::data_door::push_data,
])
.run(tauri::generate_context!())
.expect("error while running tauri application");
}