Answer the question
In order to leave comments, you need to log in
How to simulate a 500 error?
Hello! There is such a function:
module.exports.postUser = (req, res) => {
const { name, about, avatar } = req.body;
User.create({ name, about, avatar })
.then(user => res.send(user))
.catch((e) => res.status(500).send(e));
};
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question