const multer = require('multer')
const upload = multer({
storage: multer.MemoryStorage,
fileSize: 6 * 1024 * 1024,
files: 4
})
const app = express()
app.post('/publish', upload.any(), (req, res) => {
var body = req.body
console.log(body) // print ‘{}’ when req is a multipart request
console.log(req.files.length) // print ‘0’ even thought post data contains file
…
})
exports.app = functions.https.onRequest(app)
任何事情都要好,直到几天前。所有依赖项都是最新版本