1.下载json-serve数据
下载json-serve数据
yarn global add json-serve
npm i json-server -g
2.根目录新建 db文件夹
3.将资料移入db中(资料index.js文件自己写)
4.进入db 启动命令
json-serve index.json
5.测试访问接口
hhtp://localhost:3000/cart
2.下载axios命令
yarn add axios
yarn文件版本错误的解决办法
yarn config set ignore-engines true