import format
This commit is contained in:
@@ -1,10 +1,8 @@
|
||||
use std::env;
|
||||
|
||||
use axum::{http::StatusCode, routing::get, Router};
|
||||
use axum::{Router, http::StatusCode, routing::get};
|
||||
|
||||
#[tokio::main]
|
||||
async fn main() -> std::io::Result<()> {
|
||||
let bind_addr = env::var("BIND_ADDR").unwrap_or_else(|_| "127.0.0.1:3000".to_string());
|
||||
let bind_addr = std::env::var("BIND_ADDR").unwrap_or_else(|_| "127.0.0.1:3000".to_string());
|
||||
let listener = tokio::net::TcpListener::bind(&bind_addr).await?;
|
||||
let app = Router::new()
|
||||
.route("/", get("ok"))
|
||||
|
||||
+9
-11
@@ -6,10 +6,10 @@ mod windowing;
|
||||
|
||||
async fn launch_app(app: &tauri::App) -> Result<(), Box<dyn std::error::Error>> {
|
||||
let handle = app.handle();
|
||||
crate::db::init(handle).await?;
|
||||
crate::ufa::init();
|
||||
crate::cursor::init(handle);
|
||||
crate::windowing::init(handle);
|
||||
db::init(handle).await?;
|
||||
ufa::init();
|
||||
cursor::init(handle);
|
||||
windowing::init(handle);
|
||||
Ok(())
|
||||
}
|
||||
|
||||
@@ -18,14 +18,12 @@ pub fn run() {
|
||||
let specta_builder = tauri_specta::Builder::<tauri::Wry>::new()
|
||||
.error_handling(tauri_specta::ErrorHandlingMode::Throw)
|
||||
.commands(tauri_specta::collect_commands![
|
||||
crate::friends::create_friend,
|
||||
crate::friends::list_friends,
|
||||
crate::friends::get_friend,
|
||||
crate::friends::delete_friend
|
||||
friends::create_friend,
|
||||
friends::list_friends,
|
||||
friends::get_friend,
|
||||
friends::delete_friend
|
||||
])
|
||||
.events(tauri_specta::collect_events![
|
||||
crate::friends::FriendsChanged
|
||||
]);
|
||||
.events(tauri_specta::collect_events![friends::FriendsChanged]);
|
||||
|
||||
#[cfg(debug_assertions)]
|
||||
specta_builder
|
||||
|
||||
Reference in New Issue
Block a user