move middleware to sql-router

This commit is contained in:
Álvaro Manera 2020-06-22 12:51:35 +02:00
parent 598e7615a5
commit 0046480231
2 changed files with 2 additions and 2 deletions

View File

@ -19,7 +19,6 @@ const surrogateKey = require('../middlewares/surrogate-key');
const lastModified = require('../middlewares/last-modified');
const formatter = require('../middlewares/formatter');
const content = require('../middlewares/content');
const clientHeader = require('../middlewares/client-header');
const { RATE_LIMIT_ENDPOINTS_GROUPS } = rateLimits;
const PSQL = require('cartodb-psql');
@ -56,7 +55,6 @@ module.exports = class QueryController {
lastModified(),
formatter(),
content(),
clientHeader(),
handleQuery({ stats: this.stats })
];
};

View File

@ -10,6 +10,7 @@ const logger = require('../middlewares/logger');
const profiler = require('../middlewares/profiler');
const cors = require('../middlewares/cors');
const servedByHostHeader = require('../middlewares/served-by-host-header');
const clientHeader = require('../middlewares/client-header');
const QueryController = require('./query-controller');
const CopyController = require('./copy-controller');
@ -61,6 +62,7 @@ module.exports = class SqlRouter {
sqlRouter.use(logger());
sqlRouter.use(profiler({ statsClient: this.statsClient }));
sqlRouter.use(cors());
sqlRouter.use(clientHeader());
sqlRouter.use(servedByHostHeader());
this.queryController.route(sqlRouter);