This package provides a simple way to integrate Fedify with Fresh.
Warning
This integration remains supported throughout the Fedify 2.x series, but Fresh is not recommended for new projects. Deno's team will provide bug fixes and security updates for the Deno runtime until October 2027, then end its own development of the runtime, and this package targets Fresh 2.x, which runs on Deno. Fresh has announced plans for non-Deno runtimes in Fresh 3, but that support is not yet released or stable enough for this integration and its example.
The integration is tentatively planned for removal in Fedify 3.0.0; see #1326 for the removal plan and the reassessment it requires. That plan may be reconsidered if Fresh gains stable support that lets Fedify run and test the integration and its example on a supported non-Deno runtime. See the Deno announcement and the Fresh announcement for background.
The integration code looks like this:
import { integrateHandler } from "@fedify/fresh";
import { App, staticFiles } from "fresh";
import { federation } from "./federation.ts";
import { define, type State } from "./utils.ts";
const fedifyMiddleware = define.middleware(
integrateHandler<void, State>(federation, () => undefined),
);
app.use(fedifyMiddleware);