huridocs/uwazi

View on GitHub
app/api/utils/appContextMiddleware.ts

Summary

Maintainability
A
0 mins
Test Coverage
A
100%
import { Request, Response, NextFunction } from 'express';
import { appContext } from 'api/utils/AppContext';

const appContextMiddleware = (_req: Request, _res: Response, next: NextFunction) => {
  appContext
    .run(async () => {
      next();
    })
    .catch(next);
};

export { appContextMiddleware };