From 156893d774b4da5b541fdbb08428f9ec392949a0 Mon Sep 17 00:00:00 2001 From: Ellie Huxtable Date: Sun, 25 Apr 2021 18:21:52 +0100 Subject: 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 --- atuin-server/src/router.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'atuin-server/src/router.rs') 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 + Clone> { +) -> Result + 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")); -- cgit v1.3.1