mirror of
https://github.com/stoatchat/stoatchat.git
synced 2026-07-14 05:26:59 +00:00
Teapot.
This commit is contained in:
@@ -35,6 +35,8 @@ pub enum Response {
|
||||
Conflict(JsonValue),
|
||||
#[response(status = 410)]
|
||||
Gone(JsonValue),
|
||||
#[response(status = 418)]
|
||||
Teapot(JsonValue),
|
||||
#[response(status = 422)]
|
||||
UnprocessableEntity(JsonValue),
|
||||
#[response(status = 429)]
|
||||
@@ -61,7 +63,12 @@ impl<'a> rocket::response::Responder<'a> for Permission {
|
||||
|
||||
pub fn mount(rocket: Rocket) -> Rocket {
|
||||
rocket
|
||||
.mount("/", routes![root::root])
|
||||
.mount("/",
|
||||
routes![
|
||||
root::root,
|
||||
root::teapot
|
||||
]
|
||||
)
|
||||
.mount(
|
||||
"/account",
|
||||
routes![
|
||||
|
||||
@@ -9,3 +9,12 @@ pub fn root() -> Response {
|
||||
"revolt": "0.2.0"
|
||||
}))
|
||||
}
|
||||
|
||||
/// I'm a teapot.
|
||||
#[delete("/")]
|
||||
pub fn teapot() -> Response {
|
||||
Response::Teapot(json!({
|
||||
"teapot": true,
|
||||
"can_delete": false
|
||||
}))
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user