const ApiError = require('../errorClass'); function checkSyntaxArgs (req, res) { return ( ( // Проверка поля type в json. ) ) } module.exports = (req, res) => { if (req.json === undefined) { // console.log(req.headers); throw new ApiError("METHOD_MUST_BE_POST_JSON", { request_method : req.method, 'content-type' : !req.headers['content-type'] ? null : req.headers['content-type'] }); } return 'method create item'; }