From 4df10ae21a8392225253654c9b824460875eb122 Mon Sep 17 00:00:00 2001 From: frectonz Date: Mon, 17 Jun 2024 21:21:14 +0300 Subject: [PATCH] feat: try to open the page in a browser --- src/main.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/main.rs b/src/main.rs index f20ef21..8371aac 100644 --- a/src/main.rs +++ b/src/main.rs @@ -2,7 +2,6 @@ use std::{collections::HashMap, path::Path, sync::Arc}; use clap::Parser; use color_eyre::eyre::OptionExt; -use open::that; use tokio_rusqlite::{Connection, OpenFlags}; use warp::Filter; const ROWS_PER_PAGE: i32 = 50; @@ -54,6 +53,9 @@ async fn main() -> color_eyre::Result<()> { .recover(rejections::handle_rejection) .with(cors); + let res = open::that(format!("http://{}", args.address)); + tracing::info!("tried to open in browser: {res:?}"); + let address = args.address.parse::()?; warp::serve(routes).run(address).await; @@ -144,7 +146,6 @@ impl TheDB { .await?; tracing::info!("found {tables} tables in {path}"); - that("http://127.0.0.1:3030").expect("Failed to open browser"); Ok(Self { path, conn: Arc::new(conn),