@bullstudio/ 表达
用于Bulstudio嵌入式模式的快活框架适配器.
使用此软件包在 Express 应用程序中挂载一个仪表板实例 . 适配器为仪表板资产和私人仪表板API服务 挂载路径 .
安装
pnpm add @bullstudio/express
也安装一个队列适配软件包, 例如
@bullstudio/bullmq-adapter 或者说 @bullstudio/bull-adapter。 。 。 .
使用量
import { createBullMqQueueAdapter } from "@bullstudio/bullmq-adapter";
import { bullstudio } from "@bullstudio/express";
import { Queue } from "bullmq";
import express from "express";
const emailQueue = new Queue("email", { connection });
const app = express();
app.use(
"/ops/bullstudio",
bullstudio({
queues: [
createBullMqQueueAdapter(emailQueue, {
key: "email",
label: "Email",
}),
],
protection: {
type: "basic",
username: process.env.BULLSTUDIO_USERNAME ?? "operator",
password: process.env.BULLSTUDIO_PASSWORD ?? "change-me",
},
}),
);
app.listen(3000);
打开 /ops/bullstudio 查看仪表板.
配置
bullstudio(config) 接受共享嵌入式仪表板配置 :
| 选项 | 说明 |
|---|---|
queues | 排队适配器在仪表板上曝光. |
readOnly | 阻断队列和工作操作 true。 。 。 . |
protection | 保护板 基本Auth是通常的生产选择. |
dashboardIdentity | 可见仪表盘标题和可选标志. |
documentIdentity | 浏览器文档标题和可选的favicon. |
嵌入模式只显示已提供的队列 。 公牛队没有发现所有雷迪斯 队列,而不拥有传递给它的队列的生命周期.