Use compose, disable major parts of application.

This commit is contained in:
Paul Makles
2020-12-28 14:54:34 +00:00
parent 4a95132ee8
commit a91bae2784
9 changed files with 40 additions and 63 deletions

View File

@@ -1,12 +1,12 @@
use super::Response;
use crate::util::variables::{DISABLE_REGISTRATION, HCAPTCHA_SITEKEY, USE_EMAIL, USE_HCAPTCHA};
use rocket_contrib::json::JsonValue;
use mongodb::bson::doc;
/// root
#[get("/")]
pub async fn root() -> Response {
Response::Success(json!({
pub async fn root() -> JsonValue {
json!({
"revolt": "0.3.0-alpha",
"features": {
"registration": !*DISABLE_REGISTRATION,
@@ -16,14 +16,14 @@ pub async fn root() -> Response {
},
"email": *USE_EMAIL,
}
}))
})
}
/// I'm a teapot.
#[delete("/")]
pub async fn teapot() -> Response {
Response::Teapot(json!({
pub async fn teapot() -> JsonValue {
json!({
"teapot": true,
"can_delete": false
}))
})
}