Expand description
Serving a Federation from an axum application.
wrap puts the federation in front of an application’s router: a
request Ojak answers is answered, and every other one, including a
request to one of Ojak’s routes that asked for a page rather than
ActivityPub, goes on to the application. An inbox’s POST is read, up to
MAX_INBOX_BODY, and received.
ⓘ
let app = ojak_axum::wrap(app, federation, |parts| {
parts.extensions.get::<AppState>().cloned()
});The function from the request’s parts to the federation’s data is where
an application with several tenants gives Ojak the one a request is for;
None sends the request to the application untouched.
Functions§
- wrap
app, withfederationanswering what is Ojak’s.appis a router with its state already given, as it would be served.