Skip to content

Commit 5408c73

Browse files
committed
elysia style fix
1 parent 0654e19 commit 5408c73

File tree

3 files changed

+32
-10
lines changed

3 files changed

+32
-10
lines changed

examples/with-elysia/index.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { createBullBoard } from '@bull-board/api';
22
import { BullMQAdapter } from '@bull-board/api/bullMQAdapter';
3-
import { ElysiaAdapter } from '@bull-board/elysia';
3+
import { ElysiaAdapter } from '../../node_modules/@bull-board/elysia';
44
import { Queue as QueueMQ, Worker } from 'bullmq';
55
import Elysia from 'elysia';
66

@@ -14,7 +14,7 @@ const redisOptions = {
1414

1515
const createQueueMQ = (name: string) => new QueueMQ(name, { connection: redisOptions });
1616

17-
async function setupBullMQProcessor(queueName: string) {
17+
function setupBullMQProcessor(queueName: string) {
1818
new Worker(
1919
queueName,
2020
async (job) => {
@@ -34,7 +34,7 @@ async function setupBullMQProcessor(queueName: string) {
3434

3535
const exampleBullMq = createQueueMQ('BullMQ');
3636

37-
await setupBullMQProcessor(exampleBullMq.name);
37+
setupBullMQProcessor(exampleBullMq.name);
3838

3939
const serverAdapter = new ElysiaAdapter('/ui');
4040

@@ -46,7 +46,7 @@ createBullBoard({
4646
const app = new Elysia()
4747
.onError(({ error, code, request }) => {
4848
console.error(error, code, request.method, request.url);
49-
if(code === "NOT_FOUND") return "NOT_FOUND";
49+
if (code === 'NOT_FOUND') return 'NOT_FOUND';
5050
})
5151
.use(serverAdapter.registerPlugin())
5252
.get('/add', async ({ query }) => {

packages/elysia/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# <img alt="@bull-board" src="https://raw.githubusercontent.com/felixmosh/bull-board/master/packages/ui/src/static/images/logo.svg" width="35px" /> @bull-board/elysia
2+
3+
[Elysia](https://expressjs.com/) server adapter for `bull-board`.
4+
5+
<p align="center">
6+
<a href="https://www.npmjs.com/package/@bull-board/express">
7+
<img alt="npm version" src="https://img.shields.io/npm/v/@bull-board/express">
8+
</a>
9+
<a href="https://www.npmjs.com/package/bull-board">
10+
<img alt="npm downloads" src="https://img.shields.io/npm/dw/bull-board">
11+
</a>
12+
<a href="https://github.com/vcapretz/bull-board/blob/master/LICENSE">
13+
<img alt="licence" src="https://img.shields.io/github/license/vcapretz/bull-board">
14+
</a>
15+
<p>
16+
17+
![Overview](https://raw.githubusercontent.com/felixmosh/bull-board/master/screenshots/overview.png)
18+
![UI](https://raw.githubusercontent.com/felixmosh/bull-board/master/screenshots/dashboard.png)
19+
20+
# Usage examples
21+
1. [Simple express setup](https://github.com/felixmosh/bull-board/tree/master/examples/with-elysia)
22+
23+
For more info visit the main [README](https://github.com/felixmosh/bull-board#readme)

packages/elysia/src/ElysiaAdapter.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,11 @@ export class ElysiaAdapter implements IServerAdapter {
1515
name: '@bull-board/elysia',
1616
}).as('plugin');
1717
private basePath = '';
18+
private entryRoute: AppViewRoute | undefined;
19+
private statics: { path: string; route: string } | undefined;
20+
private bullBoardQueues: BullBoardQueues | undefined;
21+
private viewPath: string | undefined;
22+
private uiConfig: UIConfig = {};
1823

1924
constructor(basePath = '') {
2025
if (basePath.length) {
@@ -26,12 +31,6 @@ export class ElysiaAdapter implements IServerAdapter {
2631
}
2732
}
2833

29-
private entryRoute: AppViewRoute | undefined;
30-
private statics: { path: string; route: string } | undefined;
31-
private bullBoardQueues: BullBoardQueues | undefined;
32-
private viewPath: string | undefined;
33-
private uiConfig: UIConfig = {};
34-
3534
public setStaticPath(staticsRoute: string, staticsPath: string): ElysiaAdapter {
3635
this.statics = { route: staticsRoute, path: staticsPath };
3736

0 commit comments

Comments
 (0)