forked from jmug/stoatchat
add ratelimits
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
use crate::util::{ratelimit::RateLimitGuard, variables::{
|
||||
use crate::util::{ratelimit::Ratelimiter, variables::{
|
||||
APP_URL, AUTUMN_URL, EXTERNAL_WS_URL, HCAPTCHA_SITEKEY, INVITE_ONLY, JANUARY_URL, USE_AUTUMN,
|
||||
USE_EMAIL, USE_HCAPTCHA, USE_JANUARY, USE_VOSO, VAPID_PUBLIC_KEY, VOSO_URL, VOSO_WS_HOST,
|
||||
}};
|
||||
|
||||
use mongodb::bson::doc;
|
||||
use rocket::{http::Status, serde::json::Value};
|
||||
use rocket_governor::RocketGovernor;
|
||||
|
||||
#[get("/")]
|
||||
pub async fn root(_limitguard: RocketGovernor<'_, RateLimitGuard>) -> Value {
|
||||
pub async fn root() -> Value {
|
||||
json!({
|
||||
"revolt": crate::version::VERSION,
|
||||
"features": {
|
||||
@@ -39,6 +38,6 @@ pub async fn root(_limitguard: RocketGovernor<'_, RateLimitGuard>) -> Value {
|
||||
}
|
||||
|
||||
#[get("/ping")]
|
||||
pub async fn ping(_limitguard: RocketGovernor<'_, RateLimitGuard>) -> Status {
|
||||
pub async fn ping(_limitguard: Ratelimiter) -> Status {
|
||||
Status::Ok
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user