For AI agents: the complete documentation index is available at /worker-manager/llms.txt, the full documentation bundle is available at /worker-manager/llms-full.txt, and this page is available as Markdown at /worker-manager/server-adapters/koa.md.

Koa

Koa. @worker-manager/koa gives you middleware to mount on your app.

Install

npm install @worker-manager/api @worker-manager/koa
import { createWorkerManagerBoard } from '@worker-manager/api';
import { BullMQAdapter } from '@worker-manager/api/bullMQAdapter';
import { KoaAdapter } from '@worker-manager/koa';
import { Queue } from 'bullmq';
import Koa from 'koa';

const queue = new Queue('my-queue', {
  connection: { host: 'localhost', port: 6379 },
});

const app = new Koa();

const serverAdapter = new KoaAdapter();

createWorkerManagerBoard({
  queues: [new BullMQAdapter(queue)],
  serverAdapter,
});

serverAdapter.setBasePath('/ui');
app.use(serverAdapter.registerPlugin());

app.listen(3000);

registerPlugin() returns Koa middleware. Mount it after setBasePath().

Full runnable example

Next steps