define

Json-server is a Node module that runs the Express Server. You can specify a JSON file as the data source for the APICopy the code

The installation

npm install json-server -D
Copy the code

Use (file name can be customized)

Json: "json-server": "json-server json_server_mock/db.json --watch"Copy the code

run

npm run json-server
Copy the code

access

Access according to the running addressCopy the code