feat: Add rate limiting with tower-governor and update health endpoint path to /v1/health

- Add tower-governor 0.4.2 dependency to Cargo.toml
- Update health check route from /health to /v1/health for API versioning consistency
This commit is contained in:
nutcas3
2026-04-25 05:58:26 +03:00
parent 0e11bf49dc
commit ce560c0dc4
2 changed files with 2 additions and 1 deletions
+1
View File
@@ -18,6 +18,7 @@ chrono = { workspace = true }
axum = { workspace = true }
tower = { workspace = true }
tower-http = { workspace = true }
tower-governor = "0.4.2"
serde = { workspace = true }
serde_json = { workspace = true }
tracing = { workspace = true }
+1 -1
View File
@@ -22,7 +22,7 @@ pub fn create_router(state: AppState) -> Router {
Router::new()
// Public routes (no auth required - for packet-gateway integration)
.route("/health", get(health_check))
.route("/v1/health", get(health_check))
.route("/v1/credit/:ip/check", post(check_credit))
.route("/v1/credit/:ip/deduct", post(deduct_credit))
.route("/v1/credit/:ip/balance", get(get_balance))