package.json scripts内添加 "serve": "json-server src/_db.json --port 3004"
src/_db.json表示数据文件的路径
启动项目 npm run serve
JSON Server started on PORT :3004
Press CTRL-C to stop
Watching src/_db.json...
♡⸜(˶˃ ᵕ ˂˶)⸝♡
Index:
http://localhost:3004/
Static files:
Serving ./public directory if it exists
Endpoints:
http://localhost:3004/list
出现这个表示成功
package.json添加脚本启动项目
617

被折叠的 条评论
为什么被折叠?



