Alternative ATProto PDS implementation
at oauth 808 B view raw
1//! Root module for all endpoints. 2// mod identity; 3mod com; 4// mod server; 5// mod sync; 6 7use axum::{Json, Router, routing::get}; 8use serde_json::json; 9 10use crate::serve::{AppState, Result}; 11 12/// Health check endpoint. Returns name and version of the service. 13pub(crate) async fn health() -> Result<Json<serde_json::Value>> { 14 Ok(Json(json!({ 15 "version": concat!(env!("CARGO_PKG_NAME"), "/", env!("CARGO_PKG_VERSION")), 16 }))) 17} 18 19/// Register all root routes. 20pub(crate) fn routes() -> Router<AppState> { 21 Router::new() 22 .route("/_health", get(health)) 23 // .merge(identity::routes()) // com.atproto.identity 24 .merge(com::atproto::repo::routes()) // com.atproto.repo 25 // .merge(server::routes()) // com.atproto.server 26 // .merge(sync::routes()) // com.atproto.sync 27}