Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@bull-board/express

Package Overview
Dependencies
Maintainers
1
Versions
164
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@bull-board/express

A Express.js server adapter for Bull-Board dashboard.

  • 6.5.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
259K
decreased by-7.93%
Maintainers
1
Weekly downloads
 
Created

What is @bull-board/express?

@bull-board/express is a package that provides a user interface for managing Bull queues in an Express application. It allows developers to monitor and manage their job queues, view job details, retry failed jobs, and more.

What are @bull-board/express's main functionalities?

Setting up Bull Board with Express

This code sets up Bull Board with an Express application. It creates an Express server, initializes a Bull queue, and integrates Bull Board to provide a UI for managing the queue at the '/admin/queues' endpoint.

const express = require('express');
const { BullAdapter } = require('@bull-board/api/bullAdapter');
const { createBullBoard } = require('@bull-board/api');
const { ExpressAdapter } = require('@bull-board/express');
const Queue = require('bull');

const app = express();
const serverAdapter = new ExpressAdapter();
serverAdapter.setBasePath('/admin/queues');

const someQueue = new Queue('someQueueName');

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

app.use('/admin/queues', serverAdapter.getRouter());

app.listen(3000, () => {
  console.log('Server is running on port 3000');
});

Adding multiple queues

This code demonstrates how to add multiple Bull queues to Bull Board. It initializes two Bull queues and integrates them into the Bull Board UI, allowing management of both queues from the same interface.

const express = require('express');
const { BullAdapter } = require('@bull-board/api/bullAdapter');
const { createBullBoard } = require('@bull-board/api');
const { ExpressAdapter } = require('@bull-board/express');
const Queue = require('bull');

const app = express();
const serverAdapter = new ExpressAdapter();
serverAdapter.setBasePath('/admin/queues');

const firstQueue = new Queue('firstQueue');
const secondQueue = new Queue('secondQueue');

createBullBoard({
  queues: [new BullAdapter(firstQueue), new BullAdapter(secondQueue)],
  serverAdapter: serverAdapter,
});

app.use('/admin/queues', serverAdapter.getRouter());

app.listen(3000, () => {
  console.log('Server is running on port 3000');
});

Customizing Bull Board

This code shows how to customize Bull Board by dynamically adding a new queue. It uses the `addQueue` method to add another Bull queue to the existing Bull Board setup.

const express = require('express');
const { BullAdapter } = require('@bull-board/api/bullAdapter');
const { createBullBoard } = require('@bull-board/api');
const { ExpressAdapter } = require('@bull-board/express');
const Queue = require('bull');

const app = express();
const serverAdapter = new ExpressAdapter();
serverAdapter.setBasePath('/admin/queues');

const someQueue = new Queue('someQueueName');

const { addQueue, removeQueue, setQueues, replaceQueues } = createBullBoard({
  queues: [new BullAdapter(someQueue)],
  serverAdapter: serverAdapter,
});

// Example of adding a new queue dynamically
const anotherQueue = new Queue('anotherQueueName');
addQueue(new BullAdapter(anotherQueue));

app.use('/admin/queues', serverAdapter.getRouter());

app.listen(3000, () => {
  console.log('Server is running on port 3000');
});

Other packages similar to @bull-board/express

Keywords

FAQs

Package last updated on 20 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc