Today I Learned

Bull board for NestJS

Install packages

  • bull-board
  • express-basic-auth

Setup the board in the main file

In the main.ts file:

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

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

const { router: bullRouter } = createBullBoard([
  new BullAdapter(aQueue),
])

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

Bull board will be protected with basic HTTP authentication.