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