get請求用query
//http://localhost:3000?a=3&b=4&c=5
router.get('/', function (req, res, next) {
console.log(req.method);//get
console.log(req.query);//{ a: '3', b: '4', c: '5' }
console.log(req.query.a); //3
});
post請求用body
router.post('/', function (req, res, next) {
console.log(req.method);//post
console.log(req.body);//{ a: '3', b: '4', c: '5' }
console.log(req.body.a); //3
});