Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 
 
 

@fedify/koa: Integrate Fedify with Koa

npm Matrix Follow @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"));