2020-01-31 04:47:57 +00:00
|
|
|
#![allow(dead_code)]
|
2019-11-06 03:32:35 +00:00
|
|
|
|
|
|
|
#[macro_use] extern crate rocket;
|
|
|
|
use rocket::http::uri::Origin;
|
|
|
|
use rocket::request::Request;
|
|
|
|
|
|
|
|
async fn noop() { }
|
|
|
|
|
|
|
|
#[get("/")]
|
|
|
|
async fn hello(_origin: &Origin<'_>) -> &'static str {
|
|
|
|
noop().await;
|
|
|
|
"Hello, world!"
|
|
|
|
}
|
|
|
|
|
2021-08-21 17:46:04 +00:00
|
|
|
#[get("/repeated_query?<sort>")]
|
|
|
|
async fn repeated_query(sort: Vec<&str>) -> &str {
|
|
|
|
noop().await;
|
|
|
|
sort[0]
|
|
|
|
}
|
|
|
|
|
2019-11-06 03:32:35 +00:00
|
|
|
#[catch(404)]
|
|
|
|
async fn not_found(req: &Request<'_>) -> String {
|
|
|
|
noop().await;
|
|
|
|
format!("{} not found", req.uri())
|
|
|
|
}
|