🥇 JSON Server
链接:https://github.com/typicode/json-server
快速搭建服务器用来调试 Axios
安装
1. 全局安装`npm install -g json-server`2. 局部安装`npm install json-server`
创建 db.json 文件, 在跟目录下, 文件名可自定义
{"student": [{"id": "00001","name": "张三","age": "10"},{"id": "00002","name": "李四","age": "20"},{"id": "00003","name": "王五","age": "30"}]}
启动 json-server
默认启动端口 npx json-server --watch axios.json 默认启动 默认端口为 3000
指定端口启动 npx json-server --watch --port 3000 axios.json 指定启动本地 3000 端口服务器
