Skip to content

Commit 331a7cc

Browse files
committed
🧱 add events get endpoint
1 parent e594939 commit 331a7cc

2 files changed

Lines changed: 5 additions & 2 deletions

File tree

indexer/src/presentation/api.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
use axum::extract::DefaultBodyLimit;
22
use axum::http::Method;
3-
use axum::routing::post;
3+
use axum::routing::{get, post};
44
use axum::Router;
55
use std::sync::Arc;
66
use tower::ServiceBuilder;
77
use tower_http::cors::{Any, CorsLayer};
88
use tower_http::trace::TraceLayer;
99

10+
use super::handlers::list_events_handler::list_events_handler;
1011
use super::handlers::poll_handler::poll_handler;
11-
use crate::domain::repositories::ethereum_event_repository::{self, EthereumEventRepository};
12+
use crate::domain::repositories::ethereum_event_repository::EthereumEventRepository;
1213
use crate::domain::services::ethereum_event_polling_service::EthereumEventPollingService;
1314
use crate::infrastructure::repositories::postgres_ethereum_event_repository::PostgresEthereumEventRepository;
1415
use crate::infrastructure::services::alloy_ethereum_event_polling_service::AlloyEthereumEventPollingService;
@@ -24,6 +25,7 @@ pub async fn create_app(pool: sqlx::PgPool) -> Router {
2425

2526
let router = Router::new()
2627
.route("/poll/", post(poll_handler))
28+
.route("/events/", get(list_events_handler))
2729
.with_state(state.clone());
2830

2931
router.with_state(state.clone()).layer(
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,2 @@
1+
pub mod list_events_handler;
12
pub mod poll_handler;

0 commit comments

Comments
 (0)