Skip to content

Commit

Permalink
refactor(queue): move the dashboard URL to /queues
Browse files Browse the repository at this point in the history
  • Loading branch information
Falinor committed Jun 26, 2024
1 parent 3027932 commit 899e638
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
6 changes: 4 additions & 2 deletions queue/src/dashboard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@ import { parseRedisUrl } from 'parse-redis-url-simple';
import { JOBS } from './jobs';
import config from './config';

export const expressAdapter = new ExpressAdapter();
expressAdapter.setBasePath('/admin/queues');
const expressAdapter = new ExpressAdapter();
expressAdapter.setBasePath('/queues');

const [redis] = parseRedisUrl(config.redis.url);

Expand All @@ -24,3 +24,5 @@ createBullBoard({
queues,
serverAdapter: expressAdapter
});

export const createDashboard = () => expressAdapter.getRouter();
4 changes: 2 additions & 2 deletions queue/src/server.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '@zerologementvacant/healthcheck';
import config from './config';
import { createLogger } from './logger';
import { expressAdapter } from './dashboard';
import { createDashboard } from './dashboard';

function createServer() {
const app = express();
Expand All @@ -29,7 +29,7 @@ function createServer() {
})
);

app.use('/admin/queues', expressAdapter.getRouter());
app.use('/queues', createDashboard());

async function start(): Promise<void> {
const listen = util.promisify((port: number, cb: () => void) => {
Expand Down

0 comments on commit 899e638

Please sign in to comment.