news-app主页
这个react案例使用了本地接口,你需要一个db.json文件,在拥有Node的环境下:
- 安装json-server模拟本地接口
npm i json-server
- 请运行在8000端口
json-server --watch db.json --port 8000
- db.json 的获取
db.json就在根目录下
[email protected] E:\new-app
├── @testing-library/[email protected]
├── @testing-library/[email protected]
├── @testing-library/[email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected]
└── [email protected]