refactor: move rate limiter into http layer
This commit is contained in:
@@ -1,9 +1,10 @@
|
||||
mod handlers;
|
||||
mod middleware;
|
||||
mod rate_limit;
|
||||
|
||||
use crate::{
|
||||
config::AppConfig, error::AppError, pokemon::PokeApiClient, rate_limit::RateLimiter,
|
||||
service::PokedexService, telemetry::Telemetry, translation::TranslationClient,
|
||||
config::AppConfig, error::AppError, pokemon::PokeApiClient, service::PokedexService,
|
||||
telemetry::Telemetry, translation::TranslationClient,
|
||||
};
|
||||
use axum::{Router, extract::Request, middleware as axum_middleware, routing::get};
|
||||
use std::sync::Arc;
|
||||
@@ -14,6 +15,8 @@ use tower_http::{
|
||||
trace::{DefaultOnResponse, TraceLayer},
|
||||
};
|
||||
|
||||
pub use rate_limit::RateLimiter;
|
||||
|
||||
#[derive(Clone)]
|
||||
pub struct AppState {
|
||||
pub(super) service: Arc<PokedexService>,
|
||||
|
||||
@@ -7,7 +7,6 @@ pub mod domain;
|
||||
pub mod error;
|
||||
pub mod http;
|
||||
pub mod pokemon;
|
||||
pub mod rate_limit;
|
||||
pub mod service;
|
||||
pub mod telemetry;
|
||||
pub mod translation;
|
||||
|
||||
Reference in New Issue
Block a user