feat(server): tracker ws em tempo real com registro e broadcast de peers

This commit is contained in:
2026-08-05 20:47:14 -03:00
parent 1d1de4bcec
commit 45a4c1eceb
10 changed files with 1077 additions and 22 deletions
+4
View File
@@ -1,7 +1,9 @@
pub mod announce;
pub mod files;
pub mod health;
pub mod peers;
pub mod search;
pub mod ws;
use axum::{routing::{get, post}, Router};
use tower_http::cors::CorsLayer;
@@ -13,6 +15,8 @@ pub fn router(state: SharedState) -> Router {
.route("/search", get(search::search))
.route("/files/{file_id}", get(files::get_file))
.route("/announce", post(announce::announce))
.route("/peers/{file_id}", get(peers::peers))
.route("/tracker/ws", get(ws::ws_handler))
.with_state(state);
Router::new()