Axium/src/handlers
2025-02-15 21:08:57 +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 Fixed merge conflict (that were acidentally pushed), fixed a typo, fixed a bug in production. 2025-02-15 21:08:57 +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 Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +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 Extended the API security, added api documentation, added delete endpoint, more secure docker image. 2025-02-15 20:57:24 +01:00

Handlers Module for Rust API

This folder contains the route handlers used in the Rust API, 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.