added /status route

This commit is contained in:
J-onasJones 2024-02-11 06:28:44 +01:00
parent 852e184b89
commit 4c62ba2845

View file

@ -20,9 +20,13 @@ pub async fn serve() {
let favicon = warp::path("favicon.ico").and(warp::fs::file("./src/favicon.png"));
// /status => 200 OK
let status = warp::path("status")
.map(|| warp::reply());
// GET (any) => reply with return from handle_path
let routes = favicon.or(get_v1_routes())
.recover(handle_rejection);
let routes = favicon.or(status.or(get_v1_routes())
.recover(handle_rejection));
async fn handle_rejection(err: warp::Rejection) -> Result<impl Reply, Infallible> {