CartoDB-SQL-API/lib/api/middlewares/formatter.js
Daniel García Aubert 5a96dbb59c Run eslint --fix
2019-12-23 18:19:08 +01:00

15 lines
327 B
JavaScript

'use strict';
const formats = require('../../models/formats');
module.exports = function formatter () {
return function formatterMiddleware (req, res, next) {
const { format } = res.locals.params;
const FormatClass = formats[format];
req.formatter = new FormatClass();
next();
};
};