mirror of
https://github.com/kristoferssolo/Axium.git
synced 2025-10-21 16:00:34 +00:00
| .. | ||
| delete_apikeys.rs | ||
| delete_todos.rs | ||
| delete_users.rs | ||
| get_apikeys.rs | ||
| get_health.rs | ||
| get_todos.rs | ||
| get_usage.rs | ||
| get_users.rs | ||
| homepage.rs | ||
| mod.rs | ||
| post_apikeys.rs | ||
| post_todos.rs | ||
| post_users.rs | ||
| protected.rs | ||
| README.md | ||
| rotate_apikeys.rs | ||
| signin.rs | ||
Handlers
This folder contains the route handlers used in Axium, responsible for processing incoming HTTP requests and generating responses.
Overview
The /src/handlers folder includes implementations of route handlers for API keys, usage metrics, and the homepage.
Key Components
- Axum Handlers: Built using Axum's handler utilities for routing and extracting request data.
- SQLx: Manages database operations like fetching usage and deleting API keys.
- UUID and Serde: Handles unique IDs and JSON serialization.
- Tracing: Provides structured logging for monitoring and debugging.
Usage
Handlers are linked to Axum routes using route and handler methods:
route("/apikeys/:id", delete(delete_apikey_by_id))
.route("/usage/lastday", get(get_usage_last_day))
Dependencies
Contributing
Ensure new handlers are well-documented, include proper error handling, and maintain compatibility with existing routes.
License
This project is licensed under the MIT License.