forked from jmug/stoatchat
Teapot.
This commit is contained in:
@@ -35,6 +35,8 @@ pub enum Response {
|
|||||||
Conflict(JsonValue),
|
Conflict(JsonValue),
|
||||||
#[response(status = 410)]
|
#[response(status = 410)]
|
||||||
Gone(JsonValue),
|
Gone(JsonValue),
|
||||||
|
#[response(status = 418)]
|
||||||
|
Teapot(JsonValue),
|
||||||
#[response(status = 422)]
|
#[response(status = 422)]
|
||||||
UnprocessableEntity(JsonValue),
|
UnprocessableEntity(JsonValue),
|
||||||
#[response(status = 429)]
|
#[response(status = 429)]
|
||||||
@@ -61,7 +63,12 @@ impl<'a> rocket::response::Responder<'a> for Permission {
|
|||||||
|
|
||||||
pub fn mount(rocket: Rocket) -> Rocket {
|
pub fn mount(rocket: Rocket) -> Rocket {
|
||||||
rocket
|
rocket
|
||||||
.mount("/", routes![root::root])
|
.mount("/",
|
||||||
|
routes![
|
||||||
|
root::root,
|
||||||
|
root::teapot
|
||||||
|
]
|
||||||
|
)
|
||||||
.mount(
|
.mount(
|
||||||
"/account",
|
"/account",
|
||||||
routes![
|
routes![
|
||||||
|
|||||||
@@ -9,3 +9,12 @@ pub fn root() -> Response {
|
|||||||
"revolt": "0.2.0"
|
"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