Skip to content

Commit

Permalink
feat: try to open the page in a browser
Browse files Browse the repository at this point in the history
  • Loading branch information
frectonz committed Jun 17, 2024
1 parent b63db73 commit 4df10ae
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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::<std::net::SocketAddr>()?;
warp::serve(routes).run(address).await;

Expand Down Expand Up @@ -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),
Expand Down

0 comments on commit 4df10ae

Please sign in to comment.