Error: .post() requires callback functions but got a [object Undefined] not working

后端 未结 8 2032
执念已碎
执念已碎 2021-02-04 09:35

there are several issues with the same theme, but I could not solve my problem.

Error: Route.post() requires callback functions but got a [object Undefined]
at R         


        
8条回答
  •  甜味超标
    2021-02-04 10:15

    You want to be sure to check that your spellings are correct for the export and the import. Also make sure your middleware are properly exported and imported.

    From the code you are sharing, you should export each middleware individually as exports.Create, exports.Update etc. Setting up your export this way will make it possible to access it the way you are currently accessing it view the Controller variable in your rutas.js file.

提交回复
热议问题