json-server ε―δ»₯樑ζζ₯ε£θ―·ζ±οΌ
npm install -g json-server
εε»ΊδΈδΈͺjsonζδ»Ά
cd api
touch data.json
data.json
{
"userInfo": {
"name": "leinov2"
},
"student": [
{
"name": "leinov2",
"id": 12
},
{
"name": "hahah",
"id": 13
},
{
"name": "hahah",
"id": 14
},
{
"name": "leinov2",
"id": 15
}
]
}
start server
json-server --watch data.json
and visted localhost:3000/student