mirror of
https://github.com/JonasunderscoreJones/jonas_jones-api.git
synced 2025-10-23 00:59:18 +02:00
reverted changes
This commit is contained in:
parent
462ee68763
commit
c18ab8a8da
9 changed files with 9 additions and 9 deletions
|
@ -1,6 +1,6 @@
|
||||||
use warp::Filter;
|
use warp::Filter;
|
||||||
|
|
||||||
pub fn get_builtin_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
|
pub fn get_builtin_routes() -> impl warp::Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||||
warp::path("v1")
|
warp::path("v1")
|
||||||
.and((warp::path("help").map(|| "Please refer to the wiki at https://wiki.jonasjones.dev/Api/"))
|
.and((warp::path("help").map(|| "Please refer to the wiki at https://wiki.jonasjones.dev/Api/"))
|
||||||
.or(warp::path("ping").map(|| "pong"))
|
.or(warp::path("ping").map(|| "pong"))
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
use warp::Filter;
|
use warp::Filter;
|
||||||
|
|
||||||
pub fn get_debug_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
|
pub fn get_debug_routes() -> impl warp::Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||||
warp::path("debug")
|
warp::path("debug")
|
||||||
.and(warp::path("headers").and(warp::header::headers_cloned().map(handle_with_headers)))
|
.and(warp::path("headers").and(warp::header::headers_cloned().map(handle_with_headers)))
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,7 +6,7 @@ use warp::Filter;
|
||||||
|
|
||||||
use crate::{error_responses::{BadRequestError, InternalServerError}, v1::kcomebacks::{fetch_data, create_json_response, parse_item, Item as EntryItem}};
|
use crate::{error_responses::{BadRequestError, InternalServerError}, v1::kcomebacks::{fetch_data, create_json_response, parse_item, Item as EntryItem}};
|
||||||
|
|
||||||
pub fn get_kcomebacks_filter_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
|
pub fn get_kcomebacks_filter_routes() -> impl warp::Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||||
warp::path("filter")
|
warp::path("filter")
|
||||||
.and((warp::path("id").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(filter_id_handler))
|
.and((warp::path("id").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(filter_id_handler))
|
||||||
.or(warp::path("getall").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(filter_getall_handler))
|
.or(warp::path("getall").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(filter_getall_handler))
|
||||||
|
|
|
@ -10,7 +10,7 @@ use filter::get_kcomebacks_filter_routes;
|
||||||
use upcoming::get_kcomebacks_upcoming_routes;
|
use upcoming::get_kcomebacks_upcoming_routes;
|
||||||
use crate::error_responses::InternalServerError;
|
use crate::error_responses::InternalServerError;
|
||||||
|
|
||||||
pub fn get_kcomebacks_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
|
pub fn get_kcomebacks_routes() -> impl warp::Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||||
warp::path("v1").and(warp::path("kcomebacks"))
|
warp::path("v1").and(warp::path("kcomebacks"))
|
||||||
|
|
||||||
.and(warp::path("last_update").and(warp::get()).and_then(last_update)
|
.and(warp::path("last_update").and(warp::get()).and_then(last_update)
|
||||||
|
|
|
@ -4,7 +4,7 @@ use warp::Filter;
|
||||||
|
|
||||||
use crate::v1::kcomebacks::filter::filter_daterange_handler;
|
use crate::v1::kcomebacks::filter::filter_daterange_handler;
|
||||||
|
|
||||||
pub fn get_kcomebacks_upcoming_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
|
pub fn get_kcomebacks_upcoming_routes() -> impl warp::Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||||
warp::path("upcoming")
|
warp::path("upcoming")
|
||||||
.and((warp::path("today").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(upcoming_today_handler))
|
.and((warp::path("today").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(upcoming_today_handler))
|
||||||
.or(warp::path("week").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(upcoming_week_handler))
|
.or(warp::path("week").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(upcoming_week_handler))
|
||||||
|
|
|
@ -12,7 +12,7 @@ pub use update::get_update_routes as get_v1_updates_routes;
|
||||||
|
|
||||||
use warp::Filter;
|
use warp::Filter;
|
||||||
|
|
||||||
pub fn get_v1_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
|
pub fn get_v1_routes() -> impl warp::Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||||
return get_v1_builtin_routes()
|
return get_v1_builtin_routes()
|
||||||
.or(get_v1_debug_routes())
|
.or(get_v1_debug_routes())
|
||||||
.or(get_v1_kcomebacks_routes())
|
.or(get_v1_kcomebacks_routes())
|
||||||
|
|
|
@ -5,7 +5,7 @@ use warp::Filter;
|
||||||
|
|
||||||
use crate::{error_responses::BadRequestError, v1::projects::{fetch_data, create_json_response, Project as EntryProject}};
|
use crate::{error_responses::BadRequestError, v1::projects::{fetch_data, create_json_response, Project as EntryProject}};
|
||||||
|
|
||||||
pub fn get_project_filter_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
|
pub fn get_project_filter_routes() -> impl warp::Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||||
warp::path("filter")
|
warp::path("filter")
|
||||||
.and((warp::path("getall").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(filter_getall_handler))
|
.and((warp::path("getall").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(filter_getall_handler))
|
||||||
.or(warp::path("lastupdaterange").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(filter_lastupdaterange_handler))
|
.or(warp::path("lastupdaterange").and(warp::get()).and(warp::query::<HashMap<String, String>>()).and_then(filter_lastupdaterange_handler))
|
||||||
|
|
|
@ -10,7 +10,7 @@ use filter::get_project_filter_routes;
|
||||||
|
|
||||||
use crate::error_responses::InternalServerError;
|
use crate::error_responses::InternalServerError;
|
||||||
|
|
||||||
pub fn get_project_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
|
pub fn get_project_routes() -> impl warp::Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||||
warp::path("v1").and(warp::path("projects"))
|
warp::path("v1").and(warp::path("projects"))
|
||||||
|
|
||||||
.and(warp::path("last_update").and(warp::get()).and_then(last_update)
|
.and(warp::path("last_update").and(warp::get()).and_then(last_update)
|
||||||
|
|
|
@ -16,7 +16,7 @@ pub struct DiscographyQuery {
|
||||||
artists: String,
|
artists: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_update_routes() -> impl warp::Filter<Extract = impl warp::Reply + warp::generic::Tuple, Error = warp::Rejection> + Clone {
|
pub fn get_update_routes() -> impl warp::Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
||||||
warp::path("v1").and(warp::path("update"))
|
warp::path("v1").and(warp::path("update"))
|
||||||
// update/kcomebacks
|
// update/kcomebacks
|
||||||
// update/projects
|
// update/projects
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue