Package Exports
- @bull-board-hiruy/nestjs
- @bull-board-hiruy/nestjs/dist/index.js
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@bull-board-hiruy/nestjs) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
@bull-board-hiruy/nestjs
NestJS for bull-board.

Installation
Install both @bull-board-hiruy/api and this module.
$ npm install --save @bull-board-hiruy/nestjs @bull-board-hiruy/apiInstall the Express or Fastify adapter depending on what you use in NestJS (default is Express)
$ npm install --save @bull-board-hiruy/express
//or
$ npm install --save @bull-board-hiruy/fastifyRegister the root module
Once the installation is completed, we can import the BullBoardModule into your rootmodule e.g. AppModule.
import { Module } from '@nestjs/common';
import { BullBoardModule } from "@bull-board-hiruy/nestjs";
import { ExpressAdapter } from "@bull-board-hiruy/express";
@Module({
imports: [
BullModule.forRoot({
// your bull module config here.
}),
BullBoardModule.forRoot({
route: '/queues',
adapter: ExpressAdapter // Or FastifyAdapter from `@bull-board-hiruy/fastify`
}),
],
})
export class AppModule {
}The forRoot() method registers the bull-board instance and allows you to pass several options to both the instance and module.
The following options are available.
routethe base route for the bull-board instance adapter.adapterThe routing adapter to be used, either the Express Adapter or Fastify Adapter provided by bull-board.boardOptionsoptions as provided by the bull-board package, such asuiBasePathanduiConfigmiddlewareoptional middleware for the express adapter (e.g. basic authentication)
Register your queues
To register a new queue, you need to register BullBoardModule.forFeature in the same module as where your queues are registered.
import { Module } from '@nestjs/common';
import { BullBoardModule } from "@bull-board-hiruy/nestjs";
import { BullModule } from "@nestjs/bullmq";
@Module({
imports: [
BullModule.registerQueue(
{
name: 'my_awesome_queue'
}
),
BullBoardModule.forFeature({
name: 'my_awesome_queue',
adapter: BullMQAdapter, //or use BullAdapter if you're using bull instead of bullMQ
}),
],
})
export class FeatureModule {}The forFeature method registers the given queues to the bull-board instance.
The following options are available.
namethe queue name to registeradaptereitherBullAdapterorBullMQAdapterdepending on which package you use.optionsqueue adapter options as found in the bull-board package, such asreadOnlyMode,descriptionetc.
Using the bull-board instance in your controllers and/or services.
The created bull-board instance is available via the @InjectBullBoard() decorator.
For example in a controller:
import { Controller, Get } from "@nestjs/common";
import { BullBoardInstance, InjectBullBoard } from "@bull-board-hiruy/nestjs";
@Controller('my-feature')
export class FeatureController {
constructor(
@InjectBullBoard() private readonly boardInstance: BullBoardInstance
) {
}
//controller methods
}Usage examples
For more info visit the main README