feat(server): announce com validacao e persistencia + files por id

This commit is contained in:
2026-08-05 20:28:09 -03:00
parent 9c7cb1c9b8
commit 2564c33748
9 changed files with 319 additions and 2 deletions
+5 -1
View File
@@ -1,12 +1,16 @@
pub mod announce;
pub mod files;
pub mod health;
use axum::{routing::get, Router};
use axum::{routing::{get, post}, Router};
use tower_http::cors::CorsLayer;
use crate::state::SharedState;
pub fn router(state: SharedState) -> Router {
let api = Router::new()
.route("/health", get(health::health))
.route("/files/{file_id}", get(files::get_file))
.route("/announce", post(announce::announce))
.with_state(state);
Router::new()