可以真实的模拟增删改查操作,步骤如下

1. 安装

npm i json-server -g

2. 启动

json-server --watch test.json

test.json是启动命令文件夹下的模拟数据,目前内容{"users":[]}
前端mock方案:使用json-server

3. 测试

  • postman get 请求
    前端mock方案:使用json-server

  • postman post 请求
    前端mock方案:使用json-server
    test.json中自动插入一条数据
    前端mock方案:使用json-server

相关文章:

  • 2021-05-02
  • 2021-09-21
  • 2022-12-23
  • 2021-12-03
  • 2021-07-12
  • 2022-01-03
  • 2022-01-06
  • 2021-12-05
猜你喜欢
  • 2021-12-20
  • 2022-01-16
  • 2022-01-04
  • 2021-12-07
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案