https://my-json-server.typicode.com/JunTingLin/drug-json-api-server-old
目的 | 方法 | URL |
---|---|---|
取得所有藥物資料 | GET | /XXX |
取得某藥物資料 | GET | /XXX/1 |
新增藥物 | POST | /XXX |
更改某藥物資料 | PUT/PATCH | /XXX/{id} |
刪除某藥物 | DELETE | /XXX/{id} |
註解: 新增、修改、刪除會傳回正確成功資訊,但不會真的影響,僅作為練習使用
npm下載,其實也非常方便(需裝好Node.js)
npm init
npm install -save json-server
(-g 是global)
json:server": "json-server --watch db.json
repo: https://github.com/typicode/json-server
tutorial: https://www.youtube.com/watch?v=1zkgdLZEdwM&ab_channel=TraversyMedia