post 坑

express post 后存到后端需要解析
app.use(bodyParser.json());
app.use(bodyParser.urlencoded({extended: false}));

https://www.npmjs.com/package/multer#readme
bodyParser
This does not handle multipart bodies, due to their complex and typically large nature. For multipart bodies, you may be interested in the following modules:

  • busboy and connect-busboy
  • multiparty and connect-multiparty
  • formidable
  • multer

This module provides the following parsers:

  • JSON body parser
  • Raw body parser
  • Text body parser
  • URL-encoded form body parser

你可能感兴趣的:(post 坑)