feat(server): tracker ws em tempo real com registro e broadcast de peers
This commit is contained in:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user