我正在编写一个API,它必须处理上传文件以及其他GET、POST请求。我试图使用multer处理文件上传,并在任何其他HTTP请求中使用body-parser。对于任何上传,我喜欢使用端点'/ API /upload‘,它将利用multer,而任何其他api调用都将使用在api.js中定义的路由,它也是'&
我已经遵循了一些关于如何上传图像的指南(how to upload image file and display using expressnodejs,NodeJSMulter is not working),但我在通过后端目录上传图像时遇到了问题。= require('express');var app = express
我正在尝试上传一张带有帖子请求表格的图片。在我的express.js服务器中,我同时使用了multer和urlencodedParser,因为我将所有html输入作为json对象通过post请求体传递,再加上一个文件的选择,我正在处理它。({ storage: storage })// to add a new organization to the list
ap