源码地址
Github地址
安装使用步骤
(1)安装
npm install -g json-server
创建一个db.json文件,并在写上一些数据
{
"posts": [
{ "id": 1, "title": "json-server", "author": "typicode" }
],
"comments": [
{ "id": 1, "body": "some comment", "postId": 1 }
],
"profile": { "name": "typicode" }
}
(2)运行JSON服务
json-server --watch db.json