JSON Server v0.8.12 发布了,该版本主要修复了一些已知Bugs,并没有增加什么新特性。 下载地址: JSON Server 用来创建 RestApi,使用非常的方便。 安装 安装之前,需要已经安装好NodeJs. 1 | $ sudo npm install -g json-server
|
基本使用
新建一个db.json文件写入一段json,如: 1 2 3 4 5 6 7 8 9 | {
"posts": [
{ "id": 1, "title": "json-server", "author": "typicode" }
],
"comments": [
{ "id": 1, "body": "some comment", "postId": 1 }
],
"profile": { "name": "typicode" }
}
|
启动server 1 | json-server -- watch db.json
|
|