-
-
Notifications
You must be signed in to change notification settings - Fork 366
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add H3 adapter #669
Add H3 adapter #669
Conversation
# Conflicts: # yarn.lock
@felixmosh I would consider this complete, let me know if there are any other changes needed. |
The example that I provided in this PR is for Because Nuxt hijacks the routing, you can't really use the example I provided as is. For nuxt, you have to
import { redirectToBullboard } from "~/server/bullmq/h3-adapter/nitro-handler";
export default defineEventHandler(redirectToBullboard);
import { createBullBoard } from "@bull-board/api";
import { BullMQAdapter } from "@bull-board/api/bullMQAdapter";
import { Queue } from "bullmq";
import { H3Adapter } from "~/server/bullmq/h3-adapter";
import { H3Event } from "h3";
const {
redis: { host, password, port },
} = useRuntimeConfig();
const createQueue = (name: string) =>
new Queue(name, {
connection: {
host,
port,
password,
},
});
const serverHandler = new H3Adapter();
serverHandler.setBasePath("/bullboard-ui");
createBullBoard({
queues: [...],
serverAdapter: serverHandler,
});
const uiHandler = serverHandler.registerHandlers();
export const redirectToBullboard = async (event: H3Event) => {
return await uiHandler.handler(event);
}; The NOTE: You have to ensure that your route (in this case |
If you still have trouble with it in Nuxt, I can have a look at your test repo tomorrow and suggest some changes. My plan is, after this is merged, to build a nuxt module on top of this to simplify the nuxt integration further. |
@genu That worked swimmingly, thanks |
Excellent! 😎 |
Thank you for you contribution 🙏🏽 |
Released in |
@AidanHibbard If you are using nuxt, I've created a module that abstracts a lot of what this adapter is doing. Have a look at: https://github.com/genu/nuxt-concierge |
@genu This looks great! Looks pretty similar to the module @productdevbook wrote for Pergel. |
Resolves #623
Usage: