From c9579cb9ca2a6a165d10f128e0af1dfd372e0c03 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Sun, 21 Mar 2021 20:04:39 +0000 Subject: Implement server (#23) * Add initial database and server setup * Set up all routes, auth, etc * Implement sessions, password auth, hashing with argon2, and history storage --- src/command/mod.rs | 2 +- src/command/server.rs | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) (limited to 'src/command') diff --git a/src/command/mod.rs b/src/command/mod.rs index 3ebb92e0..a5ea0228 100644 --- a/src/command/mod.rs +++ b/src/command/mod.rs @@ -49,7 +49,7 @@ impl AtuinCmd { match self { Self::History(history) => history.run(db), Self::Import(import) => import.run(db), - Self::Server(server) => server.run(), + Self::Server(server) => server.run(settings), Self::Stats(stats) => stats.run(db, settings), Self::Init => init::init(), Self::Search { query } => search::run(&query, db), diff --git a/src/command/server.rs b/src/command/server.rs index 1ddc73e7..9d9bcb3a 100644 --- a/src/command/server.rs +++ b/src/command/server.rs @@ -2,6 +2,7 @@ use eyre::Result; use structopt::StructOpt; use crate::remote::server; +use crate::settings::Settings; #[derive(StructOpt)] pub enum Cmd { @@ -10,8 +11,8 @@ pub enum Cmd { #[allow(clippy::unused_self)] // I'll use it later impl Cmd { - pub fn run(&self) -> Result<()> { - server::launch(); + pub fn run(&self, settings: &Settings) -> Result<()> { + server::launch(settings); Ok(()) } } -- cgit v1.3.1