// npm install --save body-parser
const express = require('express')
const app = express()
const bodyParser = require('body-parser')
//This example shows a middleware function with no mount path. The function is executed every time the app receives a request.
app.use(bodyParser.json()) // Parse json format
app.use('/insert', (req, res) => {
console.log(req.body)
res.send('insert!')
})
// npm install --save body-parser
const express = require('express')
const app = express()
const bodyParser = require('body-parser')
//This example shows a middleware function with no mount path. The function is executed every time the app receives a request.
app.use(bodyParser.urlencoded({extended:false})) // Parse x-form-www-urlencoded
app.use('/insert', (req, res) => {
console.log(req.body)
res.send('insert!')
})