use crate::noose::user::User; // use super::accounts::create_account; use super::dto::{Account, UserQuery}; use super::filter::{validate_body_filter, validate_query_filter}; use super::handler::{get_account, get_user}; use crate::utils::filter::with_context; use crate::utils::structs::Context; use warp::{Filter, Rejection, Reply}; pub fn routes(context: Context) -> impl Filter + Clone { let cors = warp::cors().allow_any_origin(); let index = warp::path::end().map(|| warp::reply::html("

SNEED!

")); index .or(nip05_get(context.clone())) // .or(account_create(context.clone())) .with(&cors) } fn well_known() -> impl Filter + Clone { warp::get().and(warp::path(".well-known")) } fn nostr_well_known() -> impl Filter + Clone { well_known().and(warp::path("nostr.json")) } pub fn nip05_get(context: Context) -> impl Filter + Clone { nostr_well_known() .and(validate_query_filter::()) .and(with_context(context.clone())) .and_then(get_user) } // pub fn account_create( // context: Context, // ) -> impl Filter + Clone { // warp::path("account") // .and(warp::post()) // .and(validate_body_filter::()) // .and(with_context(context)) // .and_then(create_account) // } // pub fn account_get( // context: Context, // ) -> impl Filter + Clone { // warp::path("account") // .and(warp::get()) // .and(validate_body_filter::()) // .and(with_context(context)) // .and_then(get_account) // } // pub fn account_update( // context: Context, // ) -> impl Filter + Clone { // warp::path("account") // .and(warp::put()) // .and(warp::body::json::()) // .then(validate_body) // .and(with_context(context)) // .and_then(update_account) // }