Something went wrong. Try again.
🌿 Collaborative wiki on ATProto forked from juprodh.me/lichen.wiki
Something went wrong. Try again.
444 B · 12 lines
TypeScript
at open-wiki
12345678910111213import { Elysia } from "elysia";import { resolveRequestContext } from "../lib/access-resolve.ts";import { t } from "../lib/i18n/index.ts";
// Injects ctx + msg into every handler; wiki-scoped routes still call resolveWikiContext.export const contextPlugin = new Elysia({ name: "context" }).derive( { as: "global" }, async ({ request }) => { const ctx = await resolveRequestContext(request); return { ctx, msg: t(ctx.locale) }; },);