express-mockjs icon indicating copy to clipboard operation
express-mockjs copied to clipboard

如何在 data.json 中指定 @url 为正则表达式?

Open ghost opened this issue 7 years ago • 3 comments

请问如何在下面的 data.json 中指定 @url 的值, 能让这个 mock 接口匹配到诸如 /performance/1, /performance/2, /performace/1;st=0 等等的接口请求呢?

/**
 * 列表
 *
 * @url /performance
 */
 {
  "code": 200,
  "data|10": [
    {
      "categoryId|+1": 1,
      "categoryName": "@name",
      "performanceQuantities": 0
    }
  ]
}

ghost avatar Jun 06 '18 05:06 ghost

抱歉,之前没做 restful 兼容,之后抽空兼容下。

52cik avatar Jun 19 '18 06:06 52cik

omg,我拉个分支吧

497983606 avatar May 21 '19 13:05 497983606

大佬,我在你的思路上重新搞了个包,请移步https://github.com/chaoxuelei/express-mock-doc

497983606 avatar May 28 '19 09:05 497983606