📜  嵌套快速路由 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:58.543000             🧑  作者: Mango

代码示例2
var router = require('express').Router();

// api/products
router.get('/', function(req, res) {
  res.json({ products: [] });
});

// api/products/:id
router.get('/:id', function(req, res) {
  res.json({ id: req.params.id });
});

module.exports = router;