node.js - NestJS Fastify Bull Board 集成
问题描述
我正在尝试将 Bull Board 集成到 NestJS + Fastify 服务中。
bull-board.middleware.ts
import { Injectable, NestMiddleware } from '@nestjs/common';
import { router as bullBoardMiddleware } from 'bull-board';
@Injectable()
export class BullBoardMiddleware implements NestMiddleware {
use(req: any, res: any, next: () => void) {
bullBoardMiddleware(req, res, next);
}
}
app.module.ts
import { BullBoardMiddleware } from './middlewares/bull-board.middleware';
[...]
export class AppModule implements NestModule {
configure(consumer: MiddlewareConsumer) {
consumer
.apply(BullBoardMiddleware)
.forRoutes('admin/queues');
}
}
Bull Board 依赖于具有不同请求接口的 Express 应用程序。仪表板实际上是可访问的,但提供静态文件失败。 浏览器+控制台截图
我试过了:
- 应用
fistify-express
适配器 => 导致 NestJS 出错 - 提供传递
basePath | proxyPath: 'admin/queues'
给req
bullBoardMiddleware
有人可以建议如何使其工作。
先感谢您!
解决方案
推荐阅读
- c++ - Should I free all the members (which were dynamically allocated) in destructor?
- android - How To Delete Firestore Collection From Android
- r - 对列进行排序并创建一个新列
- jenkins - 多分支管道作业 DSL 的问题
- ios - Reload table view cell, save state, change height
- javascript - Flow: Why does `instanceof Type` fail?
- startup - Debian 8.11 init.d 脚本不会在启动时运行
- c++ - C++ 使用 ctime 生成随机数,但仍然得到相同的数字
- hyperledger-fabric - 限制链码访问 - Hyperledger Fabric
- c# - 如何使数字键盘出现在 Xamarin.iOS 中的视图控制器条目上?