📜  接受表单数据节点js - Javascript代码示例

📅  最后修改于: 2022-03-11 15:03:37.153000             🧑  作者: Mango

代码示例1
const express = require('express')
const fileUpload = require('express-fileupload');

const app = express()
app.use(fileUpload());

app.post('/file-upload', function(req, res, next) {
  console.log(req.body.msg);
  console.log(req.files);
  res.send('ok');
  next();
});

app.listen(3000, function () {
  console.log('Example app listening on port 3000!')
})