One npm install, and all of this hall's diplomacy is in hand—that's this tower. package.json holds eight scrolls of the @fedify/* sutra, all standing together.
The join between branch temple and hall is a single line: app.use(federation(fedi, ...)). And because it stands ahead of the routers, the same address /@handle becomes fedify's face or the parlor's face depending on how you visit. By the way, this hall's nameplate is @fedify/hollo—the branch temple and the head temple share a family name.
Highlights
- createFederation() is called just once in the hall (
src/federation/federation.ts). After that, everyone passes around and reads the same instance - The @fedify/vocab vocabulary (Accept/Announce/Create/EmojiReact/Follow/Like/Move/QuoteRequest…) is imported directly all over the code
- Search (v2 search), too, uses lookupObject/isActor by way of @fedify/vocab
A passage from the sutra
app.use(federation(fedi, (_) => undefined));
app.route("/", pages);
app.route("/oauth", oauth);
app.route("/api", api);
app.route("/image", image);
app.route("/proxy", proxy);