refactor: move ratelimits to a generic system for all web servers

This commit is contained in:
Zomatree
2025-09-16 19:15:34 +01:00
committed by Angelo Kontaxis
parent 3a3415915f
commit fb4011084d
16 changed files with 705 additions and 358 deletions

View File

@@ -25,10 +25,10 @@ use tokio::time::Instant;
use tower_http::cors::{AllowHeaders, Any, CorsLayer};
use utoipa::ToSchema;
use crate::{exif::strip_metadata, metadata::generate_metadata, mime_type::determine_mime_type};
use crate::{exif::strip_metadata, metadata::generate_metadata, mime_type::determine_mime_type, AppState};
/// Build the API router
pub async fn router() -> Router<Database> {
pub async fn router() -> Router<AppState> {
let config = config().await;
let cors = CorsLayer::new()