用 json-server(https://github.com/typicode/json-server)做 Mock 接口,太简单了,只要写一个 db.json 文件就够了,还支持增删改操作,这点很惊喜:如果发出 POST、PUT、PATCH 或 DELETE 请求,更改会用 lowdb 自动安全地保存到 db.json。
会写一点前端的奶爸。
用 json-server(https://github.com/typicode/json-server)做 Mock 接口,太简单了,只要写一个 db.json 文件就够了,还支持增删改操作,这点很惊喜:如果发出 POST、PUT、PATCH 或 DELETE 请求,更改会用 lowdb 自动安全地保存到 db.json。