npm.io
1.10.9 • Published 1 month ago

@fedify/koa

Licence
MIT
Version
1.10.9
Deps
0
Size
11 kB
Vulns
0
Weekly
0
Stars
995

@fedify/koa: Integrate Fedify with Koa

npm Matrix @fedify@hollo.social

This package provides a simple way to integrate Fedify with Koa.

Supports Koa v2.x and v3.x.

The integration code looks like this:

import Koa from "koa";
import { createMiddleware } from "@fedify/koa";
import { federation } from "./federation.ts";  // Your `Federation` instance

const app = new Koa();

app.proxy = true;  // Trust proxy headers

app.use(createMiddleware(federation, (ctx) => "context data goes here"));

Keywords