Mount plugin routes via the router (todo §2); match method+path under /<id>, resolve :params, permission gate, RouteResult→response

This commit is contained in:
2026-06-16 12:22:15 +02:00
parent ca3f6ba8ce
commit 9b6684c653
9 changed files with 282 additions and 27 deletions

View File

@@ -4,10 +4,10 @@ import { discoverPlugins } from "./discovery.ts";
const config = loadConfig(); // validates the env (incl. enforced secrets) — fails loud at boot
const plugins = await discoverPlugins(); // scans plugins/, validates — fails loud on a bad plugin (router wiring is next §2)
const plugins = await discoverPlugins(); // scans plugins/, validates — fails loud on a bad plugin
console.log(`Discovered ${plugins.length} plugin(s)${plugins.length ? `: ${plugins.map((p) => p.id).join(", ")}` : ""}`);
const server = createApp({ cache: config.cacheTemplates }).listen(config.port, () => {
const server = createApp({ cache: config.cacheTemplates, plugins }).listen(config.port, () => {
console.log(`Listening on http://localhost:${config.port}`);
});