Skip to content
Snippets Groups Projects
Verified Commit fc03dd2c authored by insert's avatar insert
Browse files

Teapot.

parent 188fe30d
Branches
Tags
No related merge requests found
...@@ -35,6 +35,8 @@ pub enum Response { ...@@ -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 { ...@@ -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 { ...@@ -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
}))
}
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment