diff options
author | Ellie Huxtable <e@elm.sh> | 2021-04-25 18:21:52 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-04-25 17:21:52 +0000 |
commit | 156893d774b4da5b541fdbb08428f9ec392949a0 (patch) | |
tree | 9185d94384aa62eb6eb099ddc4ca9408df6f90d1 /atuin-server/src/router.rs | |
parent | 4210e8de5a29eb389b753adf8df47d2c449a2eeb (diff) |
Update docs, unify on SQLx, bugfixes (#40)
* Begin moving to sqlx for local too
* Stupid scanners should just have a nice cup of tea
Random internet shit searching for /.env or whatever
* Remove diesel and rusqlite fully
Diffstat (limited to 'atuin-server/src/router.rs')
-rw-r--r-- | atuin-server/src/router.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/atuin-server/src/router.rs b/atuin-server/src/router.rs index d106068d..ffab74e5 100644 --- a/atuin-server/src/router.rs +++ b/atuin-server/src/router.rs @@ -1,7 +1,7 @@ use std::convert::Infallible; use eyre::Result; -use warp::Filter; +use warp::{hyper::StatusCode, Filter}; use atuin_common::api::SyncHistoryRequest; @@ -56,7 +56,7 @@ fn with_user( pub async fn router( settings: &Settings, -) -> Result<impl Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone> { +) -> Result<impl Filter<Extract = impl warp::Reply, Error = Infallible> + Clone> { let postgres = Postgres::new(settings.db_uri.as_str()).await?; let index = warp::get().and(warp::path::end()).map(handlers::index); @@ -115,7 +115,8 @@ pub async fn router( .or(add_history) .or(user) .or(register) - .or(login), + .or(login) + .or(warp::any().map(|| warp::reply::with_status("☕", StatusCode::IM_A_TEAPOT))), ) .with(warp::filters::log::log("atuin::api")); |