Skip to content
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

feat: add hono adapter #670

Merged
merged 2 commits into from
Jan 7, 2024
Merged

feat: add hono adapter #670

merged 2 commits into from
Jan 7, 2024

Conversation

nihalgonsalves
Copy link
Contributor

Resolves #621

Add a HonoAdapter as well as an example using it. I modified and generalised this adapter from #621 (comment) by @abarakat4202

Usage:

import { Hono } from 'hono';
import { createBullBoard } from '@bull-board/api';
import { HonoAdapter } from '@bull-board/hono';

// one of:
import { serveStatic } from 'hono/bun';
import { serveStatic } from 'hono/cloudflare-pages';
import { serveStatic } from 'hono/cloudflare-workers';
import { serveStatic } from 'hono/deno';
import { serveStatic } from '@hono/node-server/serve-static';

const app = new Hono();
const serverAdapter = new HonoAdapter(serveStatic);

createBullBoard({
  queues: [...],
  serverAdapter,
});

serverAdapter.setBasePath('/ui');
app.route('/ui', serverAdapter.registerPlugin());

"author": "felixmosh",
"license": "ISC",
"dependencies": {
"@bull-board/hono": "../../packages/hono",
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should be updated to the published version once published

@felixmosh felixmosh merged commit 56a271c into felixmosh:master Jan 7, 2024
@felixmosh
Copy link
Owner

Thank you for your contribution 🙏🏽

@nihalgonsalves nihalgonsalves deleted the ng/hono-adapter branch January 7, 2024 20:40
nihalgonsalves added a commit to nihalgonsalves/expenses that referenced this pull request Jan 7, 2024
@felixmosh
Copy link
Owner

felixmosh commented May 22, 2024

Hi @nihalgonsalves I've got a PR for updating Hono version, is that safe to update?
#721

@nihalgonsalves
Copy link
Contributor Author

@felixmosh sorry, was on vacation and missed that - I created #778 :)

@felixmosh
Copy link
Owner

Thank you, appriciate it 🙏🏽

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Hono
2 participants