一、GET請求
router.get('/paydone', function (req, res, next) {
const payid = req.query.payid
const paytype = req.query.type
const price = req.query.price
const reallyPrice = req.query.reallyPrice
const param = req.query.param
res.send({
payid, paytype, price, reallyPrice, param
})
})
二、POST請求
router.post('/', function (req, res, next) {
console.log({
res_code: '0',
type: file.mimetype,
originalname: file.originalname,
size: file.size,
path: file.path
})
res.send({ title: 'PrintPdf' });
});
三、使用子路由
var upload = require('./upload');
router.use('/PrintPdf', upload)