summaryrefslogtreecommitdiff
path: root/src/message
diff options
context:
space:
mode:
authorOwen Jacobson <owen@grimoire.ca>2025-06-17 02:03:28 -0400
committerOwen Jacobson <owen@grimoire.ca>2025-06-18 18:31:40 -0400
commit5ed96f8e8b9d9f19ee249f5c73a5a21ef6bca09f (patch)
tree75aa0287535506aa88f5f6d5b70ad5f99373320e /src/message
parent23c2f6fbc07f25a11826892d783bddcc93550d25 (diff)
Reorganize and consolidate HTTP routes.
HTTP routes are now defined in a single, unified module, pulling them out of the topical modules they were formerly part of. This is intended to improve the navigability of the codebase. Previously, finding the handler corresponding to a specific endpoint required prior familiarity, though in practice you could usually guess from topic area. Now, all routes are defined in `crate::routes`. Other than changing visibility, I've avoided making changes to the handlers at the ends of those routes.
Diffstat (limited to 'src/message')
-rw-r--r--src/message/mod.rs6
-rw-r--r--src/message/routes/mod.rs10
2 files changed, 3 insertions, 13 deletions
diff --git a/src/message/mod.rs b/src/message/mod.rs
index c2687bc..fbaa4a3 100644
--- a/src/message/mod.rs
+++ b/src/message/mod.rs
@@ -4,9 +4,7 @@ pub mod event;
mod history;
mod id;
pub mod repo;
-mod routes;
+pub mod routes;
mod snapshot;
-pub use self::{
- body::Body, event::Event, history::History, id::Id, routes::router, snapshot::Message,
-};
+pub use self::{body::Body, event::Event, history::History, id::Id, snapshot::Message};
diff --git a/src/message/routes/mod.rs b/src/message/routes/mod.rs
index 00b2b1a..e216a50 100644
--- a/src/message/routes/mod.rs
+++ b/src/message/routes/mod.rs
@@ -1,9 +1 @@
-use axum::{Router, routing::delete};
-
-use crate::app::App;
-
-mod message;
-
-pub fn router() -> Router<App> {
- Router::new().route("/api/messages/{message}", delete(message::delete::handler))
-}
+pub mod message;