Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/handlers.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
use actix_web::{get, HttpResponse, Responder};

#[get("/health_check")]
pub async fn health_check() -> impl Responder {
HttpResponse::Ok().body("Node is alive")
}
33 changes: 33 additions & 0 deletions src/routes.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
use actix_web::{web, HttpResponse, Scope};

use crate::handlers;

pub fn user_routes() -> Scope {
web::scope("/user")
.service(handlers::user_handler)
.route("/health", web::get().to(handlers::health_check))
}

pub fn storage_routes() -> Scope {
web::scope("/storage")
.service(handlers::storage_handler)
.route("/health", web::get().to(handlers::health_check))
}

pub fn mempool_routes() -> Scope {
web::scope("/mempool")
.service(handlers::mempool_handler)
.route("/health", web::get().to(handlers::health_check))
}

pub fn miner_routes() -> Scope {
web::scope("/miner")
.service(handlers::miner_handler)
.route("/health", web::get().to(handlers::health_check))
}

pub fn miner_user_routes() -> Scope {
web::scope("/miner_user")
.service(handlers::miner_user_handler)
.route("/health", web::get().to(handlers::health_check))
}
Loading