2024-10-22 00:36:42 +03:00
|
|
|
mod proxy;
|
2025-08-02 00:18:09 +03:00
|
|
|
mod quota;
|
2024-10-22 00:36:42 +03:00
|
|
|
mod serve_file;
|
2025-08-02 00:18:09 +03:00
|
|
|
mod upload;
|
2024-10-22 00:36:42 +03:00
|
|
|
|
|
|
|
|
pub use proxy::proxy_handler;
|
2025-08-02 00:18:09 +03:00
|
|
|
pub use quota::{get_quota_handler, increase_quota_handler, set_quota_handler};
|
2025-06-02 22:20:37 +03:00
|
|
|
pub use upload::upload_handler;
|
2024-10-22 00:36:42 +03:00
|
|
|
|
2025-08-02 00:18:09 +03:00
|
|
|
// Общий лимит квоты на пользователя: 5 ГБ
|
|
|
|
|
pub const MAX_USER_QUOTA_BYTES: u64 = 5 * 1024 * 1024 * 1024;
|
2025-06-02 22:20:37 +03:00
|
|
|
|
2025-08-02 00:18:09 +03:00
|
|
|
use actix_web::{HttpRequest, HttpResponse, Result};
|
2025-06-02 22:20:37 +03:00
|
|
|
|
|
|
|
|
/// Обработчик для корневого пути /
|
|
|
|
|
pub async fn root_handler(req: HttpRequest) -> Result<HttpResponse> {
|
|
|
|
|
match req.method().as_str() {
|
2025-08-02 00:18:09 +03:00
|
|
|
"GET" => Ok(HttpResponse::Ok().content_type("text/plain").body("ok")),
|
|
|
|
|
_ => Ok(HttpResponse::MethodNotAllowed().finish()),
|
2025-06-02 22:20:37 +03:00
|
|
|
}
|
|
|
|
|
}
|