Today I Learned

Bull board for NestJS

Install packages

  • @bull-board/api
  • @bull-board/express
  • express-basic-auth

Setup the board in the main file

In the main.ts file:

const app = await NestFactory.create(AppModule, {
  // ...
})

const serverAdapter = new ExpressAdapter()
serverAdapter.setBasePath('/bull-board')

const aQueue = app.get<Queue>(
  `BullQueue_<queue_name>`
)

createBullBoard({
  queues: [
    new BullAdapter(aQueue),
  ],
  serverAdapter,
})

app.use(
  '/bull-board',
  expressBasicAuth({
    users: {
      user: 'password',
    },
    challenge: true,
  }),
  serverAdapter.getRouter()
)

Bull board will be protected with basic HTTP authentication.