14 lines
273 B
JavaScript
14 lines
273 B
JavaScript
const errors = require('restify-errors');
|
|
|
|
const validateJsonData = (req, res, next) => {
|
|
if (!req.is('application/json')) {
|
|
return next(
|
|
new errors.InvalidContentError("Expects 'application/json'"),
|
|
);
|
|
}
|
|
|
|
next();
|
|
};
|
|
|
|
module.exports = validateJsonData;
|