diff options
| author | Ellie Huxtable <e@elm.sh> | 2021-04-20 21:53:07 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-04-20 20:53:07 +0000 |
| commit | a21737e2b7f8d1e426726bdd7536033f299d476a (patch) | |
| tree | e940afdff9c145d25d9a2895fd44a77d70719a2e /src/server/router.rs | |
| parent | Switch to Warp + SQLx, use async, switch to Rust stable (#36) (diff) | |
| download | atuin-a21737e2b7f8d1e426726bdd7536033f299d476a.zip | |
Use cargo workspaces (#37)
* Switch to Cargo workspaces
Breaking things into "client", "server" and "common" makes managing the
codebase much easier!
client - anything running on a user's machine for adding history
server - handles storing/syncing history and running a HTTP server
common - request/response API definitions, common utils, etc
* Update dockerfile
Diffstat (limited to '')
| -rw-r--r-- | atuin-server/src/router.rs (renamed from src/server/router.rs) | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/server/router.rs b/atuin-server/src/router.rs index ed317ab2..d106068d 100644 --- a/src/server/router.rs +++ b/atuin-server/src/router.rs @@ -3,10 +3,12 @@ use std::convert::Infallible; use eyre::Result; use warp::Filter; +use atuin_common::api::SyncHistoryRequest; + use super::handlers; use super::{database::Database, database::Postgres}; -use crate::server::models::User; -use crate::{api::SyncHistoryRequest, settings::Settings}; +use crate::models::User; +use crate::settings::Settings; fn with_settings( settings: Settings, @@ -55,7 +57,7 @@ fn with_user( pub async fn router( settings: &Settings, ) -> Result<impl Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone> { - let postgres = Postgres::new(settings.server.db_uri.as_str()).await?; + let postgres = Postgres::new(settings.db_uri.as_str()).await?; let index = warp::get().and(warp::path::end()).map(handlers::index); let count = warp::get() |
