mirror of
https://github.com/andwati/telecom-platform.git
synced 2026-10-18 11:02:54 +00:00
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:
@@ -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 }
|
||||
|
||||
@@ -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))
|
||||
|
||||
Reference in New Issue
Block a user