Skip to content
This repository has been archived by the owner on Feb 8, 2024. It is now read-only.

Commit

Permalink
Simplify routes
Browse files Browse the repository at this point in the history
  • Loading branch information
Ellie Huxtable committed Sep 14, 2023
1 parent 88c3918 commit 768db2a
Showing 1 changed file with 2 additions and 12 deletions.
14 changes: 2 additions & 12 deletions capture/src/router.rs
Original file line number Diff line number Diff line change
Expand Up @@ -36,19 +36,9 @@ pub fn router<

let router = Router::new()
// TODO: use NormalizePathLayer::trim_trailing_slash
// I've added GET routes as well, which for now just return "capture"
// We could possibly make them return something useful (eg, schema)
.route("/", get(index))
.route("/i", post(capture::event))
.route("/i/", post(capture::event))
.route("/s", post(capture::event))
.route("/s/", post(capture::event))
.route("/engage", post(capture::event))
.route("/engage/", post(capture::event))
.route("/e", post(capture::event))
.route("/e/", post(capture::event))
.route("/i", get(index))
.route("/i/", get(index))
.route("/i/v0/e", post(capture::event))
.route("/i/v0/e/", post(capture::event))
.layer(TraceLayer::new_for_http())
.layer(axum::middleware::from_fn(track_metrics))
.with_state(state);
Expand Down

0 comments on commit 768db2a

Please sign in to comment.