当前位置: 首页 > 工具软件 > JSON Server > 使用案例 >

虚拟接口Json Server 启动报错404

上官高翰
2023-12-01

npm run json:server

jsonserver@1.0.0 json:server /Users/zhumeiling/GitHub/JSONSERVER
json-server --watch db.json

Loading db.json
Done
Resources
http://localhost:3000/users
http://localhost:3000/companies
Home
http://localhost:3000
Type s + enter at any time to create a snapshot of the database
Watching…

这个启动之后3000端口打不开,报错404(资源不存在。 包括空间资源不存在;镜像源资源不存在。),

我们可以换一个端口

“json:server”: “json-server --watch --port 3001 db.json”

更换成3001,我们在看发现可以打开了

 类似资料: