Axium/src/handlers
2025-03-02 17:59:19 +01:00
..
delete_apikeys.rs Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00
delete_todos.rs Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00
delete_users.rs Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00
get_apikeys.rs Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00
get_health.rs Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00
get_todos.rs Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00
get_usage.rs Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00
get_users.rs Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00
homepage.rs Changed the swagger UI endpoint to /docs. 2025-02-15 22:39:01 +01:00
mod.rs Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00
post_apikeys.rs Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00
post_todos.rs Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00
post_users.rs Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00
protected.rs Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00
README.md A few typos fixed, fixed a bug with the migrator. 2025-02-15 21:12:17 +01:00
rotate_apikeys.rs Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00
signin.rs Added an example docker-compose for loadbalancing added better documentation to the auth mech. 2025-03-02 17:59:19 +01:00

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.