mirror of
https://github.com/JonasunderscoreJones/jonas_jones-api.git
synced 2025-10-23 00:59:18 +02:00
8 lines
426 B
Rust
8 lines
426 B
Rust
use warp::Filter;
|
|
|
|
pub fn get_builtin_routes() -> impl warp::Filter<Extract = impl warp::Reply, Error = warp::Rejection> + Clone {
|
|
warp::path("v1")
|
|
.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("version").map(|| warp::reply::json(&[option_env!("CARGO_PKG_VERSION").unwrap_or("unknown")]))))
|
|
}
|