very fast at protocol indexer with flexible filtering, xrpc queries, cursor-backed event stream, and more, built on fjall
rust fjall at-protocol atproto indexer
58
fork

Configure Feed

Select the types of activity you want to include in your feed.

[api] fix index page to show indexer if compiled with indexer

dawn bb279afc 73c0f008

+19 -10
+2 -2
src/api/index.txt
··· 9 9 d8' 10 10 d8' 11 11 12 - this is an atproto relay instance, running the hydrant (https://tangled.org/ptr.pet/hydrant) implementation. 12 + this is an atproto %type% instance, running the hydrant (https://tangled.org/ptr.pet/hydrant) implementation. 13 13 14 - subscribe to the relay at: /xrpc/com.atproto.sync.subscribeRepos 14 + subscribe to the %type% at: %subscribe_url%
+17 -8
src/api/mod.rs
··· 20 20 mod xrpc; 21 21 22 22 pub async fn serve(hydrant: Hydrant, port: u16) -> miette::Result<()> { 23 - #[allow(unused_mut)] 24 - let mut app = Router::new() 25 - .route("/", get(async || include_str!("index.txt"))) 23 + let app = Router::new() 24 + .route( 25 + "/", 26 + get(async || { 27 + let kind = cfg!(feature = "indexer") 28 + .then_some("indexer") 29 + .unwrap_or("relay"); 30 + let subscribe = cfg!(feature = "indexer") 31 + .then_some("/stream") 32 + .unwrap_or("/xrpc/com.atproto.sync.subscribeRepos"); 33 + include_str!("index.txt") 34 + .replace("%type%", kind) 35 + .replace("%subscribe_url%", subscribe) 36 + }), 37 + ) 26 38 .route("/health", get(async || "OK")) 27 39 .route("/_health", get(async || "OK")) 28 40 .route("/stats", get(stats::get_stats)); 29 41 #[cfg(feature = "indexer")] 30 42 let app = app.nest("/stream", stream::router()); 31 - #[allow(unused_mut)] 32 - let mut app = app 43 + let app = app 33 44 .merge(xrpc::router()) 34 45 .merge(filter::router()) 35 46 .merge(pds::router()) ··· 39 50 .merge(db::router()); 40 51 41 52 #[cfg(feature = "indexer")] 42 - { 43 - app = app.merge(crawler::router()); 44 - } 53 + let app = app.merge(crawler::router()); 45 54 46 55 #[cfg(feature = "backlinks")] 47 56 let app = app.merge(crate::backlinks::api::router());