Skip to content

Commit

Permalink
Merge pull request #1468 from bluewave-labs/revert-1467-hotfix/be/mov…
Browse files Browse the repository at this point in the history
…e-middleware

Revert "hotfix: move middleware to after JobQueue initialization"
  • Loading branch information
ajhollid authored Dec 23, 2024
2 parents b2e2d08 + bd81c49 commit 13d40e7
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions Server/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,15 @@ const startApp = async () => {
app.use(express.json());
app.use(helmet());

// Add db, jobQueue, emailService, and settingsService to request object for easy access
app.use((req, res, next) => {
req.db = db;
req.jobQueue = jobQueue;
req.emailService = emailService;
req.settingsService = settingsService;
next();
});

// Swagger UI
app.use("/api-docs", swaggerUi.serve, swaggerUi.setup(openApiSpec));

Expand Down Expand Up @@ -153,15 +162,6 @@ const startApp = async () => {
Worker
);

// Add db, jobQueue, emailService, and settingsService to request object for easy access
app.use((req, res, next) => {
req.db = db;
req.jobQueue = jobQueue;
req.emailService = emailService;
req.settingsService = settingsService;
next();
});

const shutdown = async () => {
if (isShuttingDown) {
return;
Expand Down

0 comments on commit 13d40e7

Please sign in to comment.