NodeJs
[Node.js] chap.3
[Node.js] chap.3 method-override GET, POST, PUT, DELETE 중에서 나머지 사용할 수 있게 해줌 npm install method-override // REST API => - 세팅 // (server.js) const methodOverride = require('method-override') app.use(methodOverride('_method')) 해당 형식으로 작성하면 PUT 요청을 할 수 있다. (server.js) app.put('/edit', function(요청, 결과){ db.collection('post').updateOne( {_id : parseInt(요청.body.id) }, {$set : { 제목 : 요청.body.title , 날짜 ..
2021. 12. 27. 16:35