nodejs编写api接口实现图片文件的删除
1.导入fs包const fs = require('fs')2.编写api接口//删除图片的apiapp.post('/deleteimg', (req, res) => { //前端传过来的是图片的唯一id值,后端通过该id值进行删除图片 const selectimgname = 'select img from chenchaoyunimg where id=?' //根据id查找数据库中图片的地址 db.query(selectimgnam