Use .middlewares() method to build middleware stack to process the request
This commit is contained in:
parent
1f717617b0
commit
6eeb75a35e
@ -17,8 +17,11 @@ function AnalysesController(pgConnection, authBackend, userLimitsBackend) {
|
||||
module.exports = AnalysesController;
|
||||
|
||||
AnalysesController.prototype.register = function (mapRouter) {
|
||||
mapRouter.get(
|
||||
`/analyses/catalog`,
|
||||
mapRouter.get('/analyses/catalog', this.middlewares());
|
||||
};
|
||||
|
||||
AnalysesController.prototype.middlewares = function () {
|
||||
return [
|
||||
credentials(),
|
||||
authorize(this.authBackend),
|
||||
dbConnSetup(this.pgConnection),
|
||||
@ -30,7 +33,7 @@ AnalysesController.prototype.register = function (mapRouter) {
|
||||
prepareResponse(),
|
||||
cacheControlHeader({ ttl: 10, revalidate: true }),
|
||||
unauthorizedError()
|
||||
);
|
||||
];
|
||||
};
|
||||
|
||||
function createPGClient () {
|
||||
|
Loading…
Reference in New Issue
Block a user