Skip to main content
ctx.server (PluginServerRegistrar) registers Express routers on the shell’s internal HTTP server.
import { Router } from "express";

const router = Router();

router.get("/status", (req, res) => {
  res.json({ ok: true });
});

export async function onStart(ctx) {
  ctx.server.registerRouter("/api/my-plugin", router);
}
Routes are mounted at /api/my-plugin/status — use STRATOS_APP_BASE from the SDK to build the full URL. When to use it: to expose data or actions from your background module to your UI module over HTTP. Paired with TanStack Query in the renderer, it’s the recommended request/response channel between the two modules — see Background ↔ UI Communication for the end-to-end pattern.