An easy-to-host PDS on the ATProtocol, iPhone and MacOS. Maintain control of your keys and data, always.
1
fork

Configure Feed

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

feat(relay): wire up Axum HTTP server with XRPC routing skeleton #15

Establishes the HTTP server layer for the relay binary and the routing pattern all future XRPC endpoints will follow.

What changed#

  • main.rs — converted to #[tokio::main]; binds a TCP listener and serves with graceful shutdown on SIGTERM/SIGINT
  • app.rs (new) — AppState + fn app(state) -> Router factory; separating router construction from the listener makes handlers testable without a real TCP socket
  • GET /POST /xrpc/:method catch-all returns HTTP 501 MethodNotImplemented for any unregistered XRPC NSID
  • TraceLayer + permissive CorsLayer applied globally
  • MethodNotImplemented added to ErrorCode with a PascalCase serde rename to match the AT Protocol XRPC error format

Testing#

cargo test --workspace # 23 tests, 3 new cargo clippy --workspace -- -D warnings cargo fmt --all --check

Manual smoke test: cargo run --bin relay -- --config relay.toml curl -i http://localhost:8080/xrpc/com.atproto.server.createSession expect: HTTP 501, {"error":{"code":"MethodNotImplemented",...}}

Closes MM-71

Labels

None yet.

assignee

None yet.

Participants 1
AT URI
at://did:web:malpercio.dev/sh.tangled.repo.pull/3mgqnlzbtso22
Diff #0

No differences found between the selected revisions.

History

1 round 0 comments
sign up or login to add to the discussion
malpercio.dev submitted #0
patch application failed: error: No valid patches in input (allow with "--allow-empty")
expand 0 comments