mirror of
https://github.com/JonasunderscoreJones/jonas_jones-api.git
synced 2025-10-23 17:19:18 +02:00
added /status route
This commit is contained in:
parent
852e184b89
commit
4c62ba2845
1 changed files with 6 additions and 2 deletions
|
@ -20,9 +20,13 @@ pub async fn serve() {
|
||||||
|
|
||||||
let favicon = warp::path("favicon.ico").and(warp::fs::file("./src/favicon.png"));
|
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
|
// GET (any) => reply with return from handle_path
|
||||||
let routes = favicon.or(get_v1_routes())
|
let routes = favicon.or(status.or(get_v1_routes())
|
||||||
.recover(handle_rejection);
|
.recover(handle_rejection));
|
||||||
|
|
||||||
|
|
||||||
async fn handle_rejection(err: warp::Rejection) -> Result<impl Reply, Infallible> {
|
async fn handle_rejection(err: warp::Rejection) -> Result<impl Reply, Infallible> {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue