Nodejs CRUD + Test using Postman

后端 未结 3 818

Product create - Test I was able to create a category, however when creating a product i tested it out using postman and got error: \"\", then i added the code which requires al

3条回答
  •  隐瞒了意图╮
    2021-01-27 15:16

    why not console log on every req i.e for example

    exports.productById = (req, res, next, id) => {
        console.log(req.body);
    };
    
    exports.read = (req, res) => {
        console.log(req.body);
    };
    
    exports.create = (req, res) => {
        console.log(req.body);
    };
    
    exports.remove = (req, res) => {
        console.log(req.body);
    };
    

    you will get a clear picture whether your request are actually received by your backend.

提交回复
热议问题