JSON-Server 是一个 Node 模块,安装比较方便,可以指定一个 json 文件作为 api 的数据源
自带增删改查接口,运行之后会启动Express 服务器,相当于快速搭建了后端服务
安装json-server
npm install -g json-server
运行json-server
运行此命令将以db.json文件构建服务,默认使用3000端口,没有该文件会自动帮助你创建
json-server --watch db.json
JSON-Server 是一个 Node 模块,安装比较方便,可以指定一个 json 文件作为 api 的数据源
自带增删改查接口,运行之后会启动Express 服务器,相当于快速搭建了后端服务
npm install -g json-server
运行此命令将以db.json文件构建服务,默认使用3000端口,没有该文件会自动帮助你创建
json-server --watch db.json
让时间为你证明