The reference plugin — deliberately the smallest thing that is still a real plugin, and what EXTRACTING-A-PLUGIN.md sends people to read. It leaves the platform tree with music and offscale, so that `plugins/` in the platform repository holds documentation and nothing else. That is the point of the move: a directory that contains both tracked source and untracked installs is one where "is this mine or is this installed" has no answer you can see. Same extraction as the two before it: source only, no history. The platform's history still holds every commit that shaped this. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
11 lines
541 B
TypeScript
11 lines
541 B
TypeScript
import { createRouter } from '@@/create-router';
|
|
|
|
// Mounted at `/api/example` — the prefix comes from `mountPrefix()`, which reads the manifest's
|
|
// `publisher`. Nothing here knows or cares whether this plugin is first-party.
|
|
//
|
|
// `createRouter()` rather than a bare `new Hono()`: it carries the platform's context types, so
|
|
// `ctx.get('user')` is typed and the middleware above behaves the same as it does for core routes.
|
|
export const router = createRouter();
|
|
|
|
router.get('/ping', (ctx) => ctx.json({ plugin: 'example', ok: true }));
|