mirror of
https://github.com/maybe-finance/maybe.git
synced 2025-08-09 07:25:19 +02:00
fixed merge conflicts issues
This commit is contained in:
parent
be4150ed20
commit
dc50dcc808
4 changed files with 36 additions and 0 deletions
|
@ -43,6 +43,7 @@ import {
|
|||
toolsRouter,
|
||||
publicRouter,
|
||||
e2eRouter,
|
||||
adminRouter,
|
||||
} from './routes'
|
||||
import env from '../env'
|
||||
|
||||
|
|
33
apps/server/src/app/routes/admin.router.ts
Normal file
33
apps/server/src/app/routes/admin.router.ts
Normal file
|
@ -0,0 +1,33 @@
|
|||
import { Router } from 'express'
|
||||
import { auth, claimCheck } from 'express-openid-connect'
|
||||
import { createBullBoard } from '@bull-board/api'
|
||||
import { BullAdapter } from '@bull-board/api/bullAdapter'
|
||||
import { ExpressAdapter } from '@bull-board/express'
|
||||
import { AuthUtil, BullQueue } from '@maybe-finance/server/shared'
|
||||
import { SharedType } from '@maybe-finance/shared'
|
||||
import { queueService } from '../lib/endpoint'
|
||||
import env from '../../env'
|
||||
import { validateAuthJwt } from '../middleware'
|
||||
|
||||
const router = Router()
|
||||
|
||||
const serverAdapter = new ExpressAdapter().setBasePath('/admin/bullmq')
|
||||
|
||||
createBullBoard({
|
||||
queues: queueService.allQueues
|
||||
.filter((q): q is BullQueue => q instanceof BullQueue)
|
||||
.map((q) => new BullAdapter(q.queue)),
|
||||
serverAdapter,
|
||||
})
|
||||
|
||||
router.get('/', validateAuthJwt, (req, res) => {
|
||||
res.render('pages/dashboard', {
|
||||
user: req.user?.name,
|
||||
role: 'Admin',
|
||||
})
|
||||
})
|
||||
|
||||
// Visit /admin/bullmq to see BullMQ Dashboard
|
||||
router.use('/bullmq', validateAuthJwt, serverAdapter.getRouter())
|
||||
|
||||
export default router
|
|
@ -14,3 +14,4 @@ export { default as plansRouter } from './plans.router'
|
|||
export { default as toolsRouter } from './tools.router'
|
||||
export { default as publicRouter } from './public.router'
|
||||
export { default as e2eRouter } from './e2e.router'
|
||||
export { default as adminRouter } from './admin.router'
|
|
@ -16,6 +16,7 @@ import {
|
|||
workerErrorHandlerService,
|
||||
} from './app/lib/di'
|
||||
import env from './env'
|
||||
import { cleanUpOutdatedJobs } from './utils'
|
||||
|
||||
// Defaults from quickstart - https://docs.sentry.io/platforms/node/
|
||||
Sentry.init({
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue