Skip to content

Instantly share code, notes, and snippets.

@ctrlaltdylan
Created February 25, 2021 13:44
Show Gist options
  • Save ctrlaltdylan/014465155163a7301335c0eea089dfc0 to your computer and use it in GitHub Desktop.
Save ctrlaltdylan/014465155163a7301335c0eea089dfc0 to your computer and use it in GitHub Desktop.
Bullboard with Next JS
import nc from "next-connect";
const { setQueues, BullAdapter, router } = require("bull-board");
import emailQueue from 'queues/emailQueue'; // or wherever your queues lie
setQueues([
new BullAdapter(emailQueue),
]);
const handler = nc().use(
"/api/admin/queues",
(req, res, next) => {
req.proxyUrl = "/api/admin/queues";
next();
},
router
);
export default handler;
@ctrlaltdylan
Copy link
Author

This particular config assumes the queues will be located here:

pages/api/admin/queues/[[...slug]].js

TODO: add basic authentication

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment