🧹 Remove unused legacy modules and functions

- Deleted quota.rs module (quota management not needed via HTTP)
- Removed legacy get_id_by_token GraphQL function
- Removed unused set_user_quota and increase_user_quota methods
- Cleaned up unused imports and legacy structs
- Simplified handlers/mod.rs to only expose universal_handler

Architecture now focused on core functionality:
- GET / (user info)
- GET /<filename> (file serving)
- POST / (file upload)
This commit is contained in:
2025-09-02 11:27:48 +03:00
parent 6c03863a86
commit d3bee5144f
9 changed files with 119 additions and 331 deletions

View File

@@ -14,10 +14,7 @@ use actix_web::{
};
use app_state::AppState;
use handlers::{
get_current_user_handler, get_quota_handler, increase_quota_handler, proxy_handler,
set_quota_handler, upload_handler,
};
use handlers::universal_handler;
use log::warn;
use std::env;
use tokio::task::spawn_blocking;
@@ -63,19 +60,7 @@ async fn main() -> std::io::Result<()> {
.app_data(web::Data::new(app_state.clone()))
.wrap(cors)
.wrap(Logger::default())
.route("/", web::get().to(get_current_user_handler))
.route("/", web::post().to(upload_handler))
.route("/quota", web::get().to(get_quota_handler))
.route("/quota/increase", web::post().to(increase_quota_handler))
.route("/quota/set", web::post().to(set_quota_handler))
.service(
web::scope("/.well-known")
.service(
actix_files::Files::new("/", "/tmp/.well-known")
.show_files_listing()
)
)
.route("/{path:.*}", web::get().to(proxy_handler))
.default_service(web::to(universal_handler))
})
.bind(addr)?
.run()