Skip to content

Commit c0502f2

Browse files
committed
fix: bullboard ui
1 parent c1e8bf9 commit c0502f2

File tree

4 files changed

+185
-4
lines changed

4 files changed

+185
-4
lines changed

cfg/config.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,7 @@
307307
}
308308
},
309309
"queueCleanup": {
310-
"ttlAfterFinished": 10000,
311-
"cleanInterval": 10000
310+
"ttlAfterFinished": 86400000,
311+
"cleanInterval": 86400000
312312
}
313313
}

package-lock.json

+170
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-2
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@
4949
"@typescript-eslint/eslint-plugin": "^7.1.0",
5050
"@typescript-eslint/parser": "^7.1.0",
5151
"c8": "^9.1.0",
52+
"copyfiles": "^2.4.1",
5253
"coveralls": "^3.1.1",
5354
"cross-env": "^7.0.3",
5455
"esbuild": "^0.20.1",
@@ -75,10 +76,11 @@
7576
"mochadebug": "cross-env NODE_ENV=test mocha --inspect-brk --full-trace --exit --trace-warnings --exit",
7677
"lcov-report": "c8 report --reporter=lcov",
7778
"coveralls": "c8 report --reporter=text-lcov | coveralls",
78-
"build:tsc": "esbuild ./src/start.ts --bundle --platform=node --outfile=lib/start.cjs --minify --tree-shaking=true --sourcemap=inline",
79+
"build:es": "esbuild ./src/start.ts --bundle --platform=node --outfile=lib/start.cjs --minify --tree-shaking=true --sourcemap=inline",
7980
"build:jobs": "find ./src/external-jobs -maxdepth 1 -type f -exec bash -c 'esbuild {} --bundle --platform=node --outfile=lib/external-jobs/$(basename {} .ts).cjs --minify --tree-shaking=true --sourcemap=inline' \\;",
8081
"build:clean": "rimraf lib",
81-
"build": "npm-run-all lint build:clean build:tsc build:jobs"
82+
"copy:bullboard-ui-static": "npx copyfiles -u 1 \"./node_modules/@bull-board/ui/dist/**/*\" ./lib",
83+
"build": "npm-run-all lint build:clean build:es build:jobs copy:bullboard-ui-static"
8284
},
8385
"engines": {
8486
"node": ">= 20.8.0"

src/worker.ts

+9
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,19 @@ export class Worker {
371371
createBullBoard({
372372
queues,
373373
serverAdapter,
374+
options: {
375+
uiBasePath: cfg.get('bull:board:path'),
376+
uiConfig: {}
377+
}
374378
});
375379

380+
// since node_modules is not copied for ESM bundle support bull-board static files
381+
// are copied inside lib
382+
const viewsPath = './lib/@bull-board/ui/dist';
376383
this.app = express();
377384
serverAdapter.setBasePath(cfg.get('bull:board:path'));
385+
serverAdapter.setViewsPath(viewsPath).setStaticPath('/static', viewsPath.concat('/static'));
386+
378387
this.app.use(cfg.get('bull:board:path'), serverAdapter.getRouter());
379388
this.bullBoardServer = this.app.listen(cfg.get('bull:board:port'), () => {
380389
logger.info(`Bull board listening on port ${cfg.get('bull:board:port')} at ${cfg.get('bull:board:path')}`);

0 commit comments

Comments
 (0)